質問編集履歴
1
controller.javaの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -60,6 +60,56 @@
|
|
60
60
|
|
61
61
|
```java
|
62
62
|
|
63
|
+
package com.example.test1.controller;
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
import java.io.IOException;
|
68
|
+
|
69
|
+
import java.io.PrintWriter;
|
70
|
+
|
71
|
+
import java.text.SimpleDateFormat;
|
72
|
+
|
73
|
+
import java.util.Date;
|
74
|
+
|
75
|
+
import java.util.List;
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
import javax.servlet.http.HttpServletResponse;
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
84
|
+
|
85
|
+
import org.springframework.http.ResponseEntity;
|
86
|
+
|
87
|
+
import org.springframework.stereotype.Controller;
|
88
|
+
|
89
|
+
import org.springframework.transaction.annotation.Transactional;
|
90
|
+
|
91
|
+
import org.springframework.ui.Model;
|
92
|
+
|
93
|
+
import org.springframework.util.MimeTypeUtils;
|
94
|
+
|
95
|
+
import org.springframework.web.bind.annotation.ModelAttribute;
|
96
|
+
|
97
|
+
import org.springframework.web.bind.annotation.RequestBody;
|
98
|
+
|
99
|
+
import org.springframework.web.bind.annotation.RequestMapping;
|
100
|
+
|
101
|
+
import org.springframework.web.bind.annotation.RequestMethod;
|
102
|
+
|
103
|
+
import org.springframework.web.bind.annotation.ResponseBody;
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
@Controller
|
108
|
+
|
109
|
+
public class test1Controller {
|
110
|
+
|
111
|
+
|
112
|
+
|
63
113
|
@RequestMapping(value = "/test1/test1", method = RequestMethod.GET)
|
64
114
|
|
65
115
|
public String displayUserAdd(Model model) {
|
@@ -70,12 +120,64 @@
|
|
70
120
|
|
71
121
|
}
|
72
122
|
|
123
|
+
}
|
124
|
+
|
73
125
|
```
|
74
126
|
|
75
127
|
test2のcontroller.javaは
|
76
128
|
|
77
129
|
```java
|
78
130
|
|
131
|
+
package com.example.test2.controller;
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
import java.io.IOException;
|
136
|
+
|
137
|
+
import java.io.PrintWriter;
|
138
|
+
|
139
|
+
import java.text.SimpleDateFormat;
|
140
|
+
|
141
|
+
import java.util.Date;
|
142
|
+
|
143
|
+
import java.util.List;
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
import javax.servlet.http.HttpServletResponse;
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
152
|
+
|
153
|
+
import org.springframework.http.ResponseEntity;
|
154
|
+
|
155
|
+
import org.springframework.stereotype.Controller;
|
156
|
+
|
157
|
+
import org.springframework.transaction.annotation.Transactional;
|
158
|
+
|
159
|
+
import org.springframework.ui.Model;
|
160
|
+
|
161
|
+
import org.springframework.util.MimeTypeUtils;
|
162
|
+
|
163
|
+
import org.springframework.web.bind.annotation.ModelAttribute;
|
164
|
+
|
165
|
+
import org.springframework.web.bind.annotation.RequestBody;
|
166
|
+
|
167
|
+
import org.springframework.web.bind.annotation.RequestMapping;
|
168
|
+
|
169
|
+
import org.springframework.web.bind.annotation.RequestMethod;
|
170
|
+
|
171
|
+
import org.springframework.web.bind.annotation.ResponseBody;
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
@Controller
|
176
|
+
|
177
|
+
public class test2Controller {
|
178
|
+
|
179
|
+
|
180
|
+
|
79
181
|
@RequestMapping(value = "/test2/test2", method = RequestMethod.GET)
|
80
182
|
|
81
183
|
public String displayUserAdd(Model model) {
|
@@ -86,6 +188,8 @@
|
|
86
188
|
|
87
189
|
}
|
88
190
|
|
191
|
+
}
|
192
|
+
|
89
193
|
```
|
90
194
|
|
91
195
|
としています。
|
@@ -101,3 +205,9 @@
|
|
101
205
|
フォルダ構成に間違い等あるのでしょうか?
|
102
206
|
|
103
207
|
最適なフォルダ構成を教えてもらえないでしょうか?
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
controller.javaに追記しました。
|
212
|
+
|
213
|
+
test1のcontroller.javaの飛び先をtest2/test2にすると問題なくtest2.htmが表示されました。
|