質問編集履歴
3
削除された内容の復元を行いました
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
javaを教えてください
|
1
|
+
課金額を入力できないようにするjavaを教えてください
|
body
CHANGED
@@ -1,1 +1,32 @@
|
|
1
|
+
課金額に負数を入力できないようにするjavaを教えてください。
|
2
|
+
package com.example.billing.Controller;
|
3
|
+
import com.example.billing.Data.*;
|
4
|
+
import com.example.billing.Request.*;
|
5
|
+
import com.example.billing.Service.*;
|
6
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
7
|
+
import org.springframework.stereotype.Controller;
|
8
|
+
import org.springframework.ui.Model;
|
9
|
+
import org.springframework.web.bind.annotation.GetMapping;
|
10
|
+
import org.springframework.web.bind.annotation.ModelAttribute;
|
11
|
+
import org.springframework.web.bind.annotation.PathVariable;
|
12
|
+
import org.springframework.web.bind.annotation.PostMapping;
|
13
|
+
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
14
|
+
@Controller
|
15
|
+
public class EditController {
|
16
|
+
@Autowired
|
17
|
+
BillingService BillingService;
|
18
|
+
@GetMapping(value = "/edit/{id}")
|
19
|
+
public String edit(@PathVariable("id") final Integer id, Model model) {
|
20
|
+
Billing Billing = BillingService.findById(id);
|
21
|
+
model.addAttribute("title", "編集画面");
|
22
|
+
model.addAttribute("billing", Billing);
|
23
|
+
return "edit";
|
24
|
+
}
|
25
|
+
@PostMapping(value = "/update")
|
26
|
+
public String update(@ModelAttribute final BillingEditRequest BillingEditRequest,
|
27
|
+
RedirectAttributes RedirectAttributes, Model model) {
|
28
|
+
BillingService.edit(BillingEditRequest);
|
1
|
-
|
29
|
+
RedirectAttributes.addAttribute("app", BillingEditRequest.getApplication());
|
30
|
+
return "redirect:/billinghistory/{app}";
|
31
|
+
}
|
32
|
+
}
|
2
V画面を開いたときに今日の日付を入力
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
javaを教えてください
|
body
CHANGED
File without changes
|
1
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
課金額
|
1
|
+
課金額を入力できないようにするjavaを教えてください
|
body
CHANGED
@@ -1,46 +1,1 @@
|
|
1
|
-
課金額に負数を入力できないようにするjavaを教えてください。
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
package com.example.billing.Controller;
|
6
|
-
|
7
|
-
import com.example.billing.Data.*;
|
8
|
-
import com.example.billing.Request.*;
|
9
|
-
import com.example.billing.Service.*;
|
10
|
-
|
11
|
-
import org.springframework.beans.factory.annotation.Autowired;
|
12
|
-
import org.springframework.stereotype.Controller;
|
13
|
-
import org.springframework.ui.Model;
|
14
|
-
import org.springframework.web.bind.annotation.GetMapping;
|
15
|
-
import org.springframework.web.bind.annotation.ModelAttribute;
|
16
|
-
import org.springframework.web.bind.annotation.PathVariable;
|
17
|
-
import org.springframework.web.bind.annotation.PostMapping;
|
18
|
-
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
19
|
-
|
20
|
-
@Controller
|
21
|
-
public class EditController {
|
22
|
-
|
23
|
-
@Autowired
|
24
|
-
BillingService BillingService;
|
25
|
-
|
26
|
-
@GetMapping(value = "/edit/{id}")
|
27
|
-
public String edit(@PathVariable("id") final Integer id, Model model) {
|
28
|
-
|
29
|
-
Billing Billing = BillingService.findById(id);
|
30
|
-
|
31
|
-
model.addAttribute("title", "編集画面");
|
32
|
-
model.addAttribute("billing", Billing);
|
33
|
-
return "edit";
|
34
|
-
|
35
|
-
}
|
36
|
-
|
37
|
-
@PostMapping(value = "/update")
|
38
|
-
public String update(@ModelAttribute final BillingEditRequest BillingEditRequest,
|
39
|
-
RedirectAttributes RedirectAttributes, Model model) {
|
40
|
-
|
41
|
-
BillingService.edit(BillingEditRequest);
|
42
|
-
|
1
|
+
回答してくれる方がわかりやすいような質問を心がけましょう。具体的な事象やソースコード、既に試行した事を記載すると議論にならずスムーズに回答が得られやすくなります。質問するときのヒントも参照ください。
|
43
|
-
return "redirect:/billinghistory/{app}";
|
44
|
-
}
|
45
|
-
|
46
|
-
}
|