質問編集履歴
2
ソースコード変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -4,6 +4,22 @@
|
|
4
4
|
public class SearchForm {
|
5
5
|
private Date datefrom;
|
6
6
|
private Date dateto;
|
7
|
+
|
8
|
+
public Date getDatefrom() {
|
9
|
+
return datefrom;
|
10
|
+
}
|
11
|
+
public void setDatefrom(Date datefrom) {
|
12
|
+
this.datefrom = datefrom;
|
13
|
+
}
|
14
|
+
public Date getDateto() {
|
15
|
+
return dateto;
|
16
|
+
}
|
17
|
+
public void setDateto(Date dateto) {
|
18
|
+
this.dateto = dateto;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
|
7
23
|
```
|
8
24
|
|
9
25
|
```HTML
|
@@ -25,6 +41,15 @@
|
|
25
41
|
```Controller
|
26
42
|
@PostMapping("/searchresult")
|
27
43
|
public ModelAndView searchresult(@ModelAttribute("searchForm") SearchForm form,BindingResult result,
|
28
|
-
ModelAndView mav)
|
44
|
+
ModelAndView mav,Search entity){
|
45
|
+
if(result.hasErrors()) {
|
46
|
+
return mav;
|
47
|
+
}
|
48
|
+
mav.setViewName("searchresult");
|
49
|
+
mav.addObject("searchForm", new SearchForm());
|
50
|
+
Iterable<Kakeibo> list = service.searchAll(form);
|
51
|
+
mav.addObject("datalist", list);
|
52
|
+
return mav;
|
53
|
+
}
|
29
54
|
```
|
30
55
|

|
1
画像の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -26,4 +26,5 @@
|
|
26
26
|
@PostMapping("/searchresult")
|
27
27
|
public ModelAndView searchresult(@ModelAttribute("searchForm") SearchForm form,BindingResult result,
|
28
28
|
ModelAndView mav)
|
29
|
-
```
|
29
|
+
```
|
30
|
+

|