質問編集履歴
1
controller.javaの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -29,19 +29,71 @@
|
|
29
29
|
|
30
30
|
test1のcontroller.javaは
|
31
31
|
```java
|
32
|
+
package com.example.test1.controller;
|
33
|
+
|
34
|
+
import java.io.IOException;
|
35
|
+
import java.io.PrintWriter;
|
36
|
+
import java.text.SimpleDateFormat;
|
37
|
+
import java.util.Date;
|
38
|
+
import java.util.List;
|
39
|
+
|
40
|
+
import javax.servlet.http.HttpServletResponse;
|
41
|
+
|
42
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
43
|
+
import org.springframework.http.ResponseEntity;
|
44
|
+
import org.springframework.stereotype.Controller;
|
45
|
+
import org.springframework.transaction.annotation.Transactional;
|
46
|
+
import org.springframework.ui.Model;
|
47
|
+
import org.springframework.util.MimeTypeUtils;
|
48
|
+
import org.springframework.web.bind.annotation.ModelAttribute;
|
49
|
+
import org.springframework.web.bind.annotation.RequestBody;
|
50
|
+
import org.springframework.web.bind.annotation.RequestMapping;
|
51
|
+
import org.springframework.web.bind.annotation.RequestMethod;
|
52
|
+
import org.springframework.web.bind.annotation.ResponseBody;
|
53
|
+
|
54
|
+
@Controller
|
55
|
+
public class test1Controller {
|
56
|
+
|
32
57
|
@RequestMapping(value = "/test1/test1", method = RequestMethod.GET)
|
33
58
|
public String displayUserAdd(Model model) {
|
34
59
|
model.addAttribute("memberRequest", new MemberRequest());
|
35
60
|
return "test1/test1";
|
36
61
|
}
|
62
|
+
}
|
37
63
|
```
|
38
64
|
test2のcontroller.javaは
|
39
65
|
```java
|
66
|
+
package com.example.test2.controller;
|
67
|
+
|
68
|
+
import java.io.IOException;
|
69
|
+
import java.io.PrintWriter;
|
70
|
+
import java.text.SimpleDateFormat;
|
71
|
+
import java.util.Date;
|
72
|
+
import java.util.List;
|
73
|
+
|
74
|
+
import javax.servlet.http.HttpServletResponse;
|
75
|
+
|
76
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
77
|
+
import org.springframework.http.ResponseEntity;
|
78
|
+
import org.springframework.stereotype.Controller;
|
79
|
+
import org.springframework.transaction.annotation.Transactional;
|
80
|
+
import org.springframework.ui.Model;
|
81
|
+
import org.springframework.util.MimeTypeUtils;
|
82
|
+
import org.springframework.web.bind.annotation.ModelAttribute;
|
83
|
+
import org.springframework.web.bind.annotation.RequestBody;
|
84
|
+
import org.springframework.web.bind.annotation.RequestMapping;
|
85
|
+
import org.springframework.web.bind.annotation.RequestMethod;
|
86
|
+
import org.springframework.web.bind.annotation.ResponseBody;
|
87
|
+
|
88
|
+
@Controller
|
89
|
+
public class test2Controller {
|
90
|
+
|
40
91
|
@RequestMapping(value = "/test2/test2", method = RequestMethod.GET)
|
41
92
|
public String displayUserAdd(Model model) {
|
42
93
|
model.addAttribute("memberRequest", new MemberRequest());
|
43
94
|
return "test2/test2";
|
44
95
|
}
|
96
|
+
}
|
45
97
|
```
|
46
98
|
としています。
|
47
99
|
|
@@ -49,4 +101,7 @@
|
|
49
101
|
localhost:8080/test2/test2にアクセスするとWhitelabel Error Pageが表示され、test2.htmlが表示されません。
|
50
102
|
|
51
103
|
フォルダ構成に間違い等あるのでしょうか?
|
52
|
-
最適なフォルダ構成を教えてもらえないでしょうか?
|
104
|
+
最適なフォルダ構成を教えてもらえないでしょうか?
|
105
|
+
|
106
|
+
controller.javaに追記しました。
|
107
|
+
test1のcontroller.javaの飛び先をtest2/test2にすると問題なくtest2.htmが表示されました。
|