質問編集履歴
1
ああああああああああああああああああ
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
ああああああああああああああああああ
|
test
CHANGED
@@ -1,393 +1 @@
|
|
1
|
-
### 前提・実現したいこと
|
2
|
-
|
3
|
-
タイトルの通りになりますが、リクエストスコープを使って値を取得したいです。
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
### 発生している問題・エラーメッセージ
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
```
|
12
|
-
|
13
|
-
タイプ 例外報告
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
メッセージ /WEB-INF/jsp/formresult.jsp (行:[3]、列:[17]) 引用符が必要です
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
説明 サーバーは予期しない条件に遭遇しました。それはリクエストの実行を妨げます。
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
例外
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
org.apache.jasper.JasperException: /WEB-INF/jsp/formresult.jsp (行:[3]、列:[17]) 引用符が必要です
|
30
|
-
|
31
|
-
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
|
32
|
-
|
33
|
-
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292)
|
34
|
-
|
35
|
-
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:98)
|
36
|
-
|
37
|
-
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:237)
|
38
|
-
|
39
|
-
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:168)
|
40
|
-
|
41
|
-
org.apache.jasper.compiler.Parser.parsePageDirective(Parser.java:356)
|
42
|
-
|
43
|
-
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:478)
|
44
|
-
|
45
|
-
org.apache.jasper.compiler.Parser.parseFileDirectives(Parser.java:1797)
|
46
|
-
|
47
|
-
org.apache.jasper.compiler.Parser.parse(Parser.java:141)
|
48
|
-
|
49
|
-
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
|
50
|
-
|
51
|
-
org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:127)
|
52
|
-
|
53
|
-
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
|
54
|
-
|
55
|
-
org.apache.jasper.compiler.Compiler.compile(Compiler.java:392)
|
56
|
-
|
57
|
-
org.apache.jasper.compiler.Compiler.compile(Compiler.java:368)
|
58
|
-
|
59
|
-
org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
|
60
|
-
|
61
|
-
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:605)
|
62
|
-
|
63
|
-
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:400)
|
64
|
-
|
65
|
-
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:378)
|
66
|
-
|
67
|
-
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:326)
|
68
|
-
|
69
|
-
javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
|
70
|
-
|
71
|
-
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
|
72
|
-
|
73
|
-
sample.form.doPost(form.java:52)
|
74
|
-
|
75
|
-
javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
|
76
|
-
|
77
|
-
javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
|
78
|
-
|
79
|
-
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
|
80
|
-
|
81
|
-
注意 原因のすべてのスタックトレースは、サーバのログに記録されています
|
82
|
-
|
83
|
-
```
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
### 該当のソースコード
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
```ここに言語名を入力
|
92
|
-
|
93
|
-
package model;
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
public class formproduct implements java.io.Serializable {
|
98
|
-
|
99
|
-
private String name;
|
100
|
-
|
101
|
-
private String price;
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
public formproduct() {}
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
public formproduct(String name,String price) {
|
110
|
-
|
111
|
-
this.name=name;
|
112
|
-
|
113
|
-
this.price=price;
|
114
|
-
|
115
|
-
}
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
public String getName() {
|
120
|
-
|
121
|
-
return name;
|
122
|
-
|
123
|
-
}
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
public void setName(String name) {
|
128
|
-
|
129
|
-
this.name = name;
|
130
|
-
|
131
|
-
}
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
public String getPrice() {
|
136
|
-
|
137
|
-
return price;
|
138
|
-
|
139
|
-
}
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
1
|
+
ああああああああああああああああああああああああああああああああああああ
|
144
|
-
|
145
|
-
this.price = price;
|
146
|
-
|
147
|
-
}
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
}
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
```
|
158
|
-
|
159
|
-
`````````
|
160
|
-
|
161
|
-
package sample;
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
import java.io.IOException;
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
import javax.servlet.RequestDispatcher;
|
170
|
-
|
171
|
-
import javax.servlet.ServletException;
|
172
|
-
|
173
|
-
import javax.servlet.annotation.WebServlet;
|
174
|
-
|
175
|
-
import javax.servlet.http.HttpServlet;
|
176
|
-
|
177
|
-
import javax.servlet.http.HttpServletRequest;
|
178
|
-
|
179
|
-
import javax.servlet.http.HttpServletResponse;
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
import model.formproduct;
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
/**
|
188
|
-
|
189
|
-
* Servlet implementation class form
|
190
|
-
|
191
|
-
*/
|
192
|
-
|
193
|
-
@WebServlet("/form")
|
194
|
-
|
195
|
-
public class form extends HttpServlet {
|
196
|
-
|
197
|
-
private static final long serialVersionUID = 1L;
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
/**
|
202
|
-
|
203
|
-
* @see HttpServlet#HttpServlet()
|
204
|
-
|
205
|
-
*/
|
206
|
-
|
207
|
-
public form() {
|
208
|
-
|
209
|
-
super();
|
210
|
-
|
211
|
-
// TODO Auto-generated constructor stub
|
212
|
-
|
213
|
-
}
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
/**
|
218
|
-
|
219
|
-
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
|
220
|
-
|
221
|
-
*/
|
222
|
-
|
223
|
-
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
224
|
-
|
225
|
-
RequestDispatcher rd=request.getRequestDispatcher("/WEB-INF/jsp/form.jsp");
|
226
|
-
|
227
|
-
rd.forward(request, response);
|
228
|
-
|
229
|
-
}
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
/**
|
234
|
-
|
235
|
-
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
236
|
-
|
237
|
-
*/
|
238
|
-
|
239
|
-
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
240
|
-
|
241
|
-
request.setCharacterEncoding("UTF-8");
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
String name=request.getParameter("name");
|
246
|
-
|
247
|
-
String price=request.getParameter("price");
|
248
|
-
|
249
|
-
formproduct fp=new formproduct();
|
250
|
-
|
251
|
-
fp.setName(name);
|
252
|
-
|
253
|
-
fp.setPrice(price);
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
request.setAttribute("formproduct", fp);
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
RequestDispatcher rd=request.getRequestDispatcher("/WEB-INF/jsp/formresult.jsp");
|
262
|
-
|
263
|
-
rd.forward(request, response);
|
264
|
-
|
265
|
-
}
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
}
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
```
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
```<%@ page language="java" contentType="text/html; charset=UTF-8"
|
278
|
-
|
279
|
-
pageEncoding="UTF-8"%>
|
280
|
-
|
281
|
-
<%@ page import=model.formproduct %>
|
282
|
-
|
283
|
-
<%
|
284
|
-
|
285
|
-
formproduct fp= (formproduct) request.getAttribute("formproduct");
|
286
|
-
|
287
|
-
%>
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
<!DOCTYPE html>
|
294
|
-
|
295
|
-
<html>
|
296
|
-
|
297
|
-
<head>
|
298
|
-
|
299
|
-
<meta charset="UTF-8">
|
300
|
-
|
301
|
-
<title>formstudy</title>
|
302
|
-
|
303
|
-
</head>
|
304
|
-
|
305
|
-
<body>
|
306
|
-
|
307
|
-
<h1>formの内容</h1>
|
308
|
-
|
309
|
-
<p>
|
310
|
-
|
311
|
-
name:<%=fp.getName()%>
|
312
|
-
|
313
|
-
price:<%=fp.getPrice()%>
|
314
|
-
|
315
|
-
</p>
|
316
|
-
|
317
|
-
</body>
|
318
|
-
|
319
|
-
</html>
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
```
|
324
|
-
|
325
|
-
```ここに言語を入力
|
326
|
-
|
327
|
-
package model;
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
public class formproduct implements java.io.Serializable {
|
332
|
-
|
333
|
-
private String name;
|
334
|
-
|
335
|
-
private String price;
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
public formproduct() {}
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
public formproduct(String name,String price) {
|
344
|
-
|
345
|
-
this.name=name;
|
346
|
-
|
347
|
-
this.price=price;
|
348
|
-
|
349
|
-
}
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
public String getName() {
|
354
|
-
|
355
|
-
return name;
|
356
|
-
|
357
|
-
}
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
public void setName(String name) {
|
362
|
-
|
363
|
-
this.name = name;
|
364
|
-
|
365
|
-
}
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
public String getPrice() {
|
370
|
-
|
371
|
-
return price;
|
372
|
-
|
373
|
-
}
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
public void setPrice(String price) {
|
378
|
-
|
379
|
-
this.price = price;
|
380
|
-
|
381
|
-
}
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
}
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
```
|
392
|
-
|
393
|
-
jasperのエラートのことだったのでリンク先が間違ってないかなど調べましたが原因がわからなかったため、ご教授いただければ幸いです。
|