質問編集履歴

1

hhhhhhhhhhhh

2016/05/05 08:27

投稿

diiko
diiko

スコア8

test CHANGED
File without changes
test CHANGED
@@ -1,313 +1,37 @@
1
- strutsを使用し社員検索画面を作成しているのですが、jsp側で検索した結果を取得すると格納されていたデータがなくなっています、どうすればいいでしょうか?
1
+ <!DOCTYPE html>
2
2
 
3
- デバッグしてみるとサーブレット側でフォームに格納しているところまでは確認できています。
4
-
5
-
6
-
7
- 宜しくお願いします。
8
-
9
-
10
-
11
- jsp
12
-
13
- <%@ page contentType="text/html; charset=Windows-31J"%>
14
-
15
- <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
16
-
17
- <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
18
-
19
- <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
20
-
21
- <%@ page import="java.util.List" %>
22
-
23
- <%@ page import="form.SyainDataForm"%>
24
-
25
-
26
-
27
- <html:html>
3
+ <html>
28
4
 
29
5
  <head>
30
6
 
31
- <meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
7
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
32
8
 
33
- <title>社員情報一覧画面</title>
9
+ <title>アンケート調査</title>
34
-
35
- <LINK href="./view/css/Common.css" rel="stylesheet" type="text/css">
36
10
 
37
11
  </head>
38
12
 
39
13
  <body>
40
14
 
41
- <div class="main">
15
+ <h1>アンケート調査</h1>
42
16
 
43
- <h1>【社員情報一覧】</h1>
17
+ <form method="POST" action="Quest1.jsp">
44
18
 
45
- <bean:define id="syainList" name="SyainDataForm" property="searchResultList" type="java.util.List" scope="request"/>
19
+ ●あなたの好きな食べ物は?
46
20
 
47
- <div class="list">
21
+ <select name="food">
48
22
 
49
- <font><%=syainList.size() %></font>
23
+ <option value="3">ラーメン</option>
50
24
 
51
- <table border=1 >
25
+ <option value="2">カレーライス</option>
52
26
 
53
- <tr>
27
+ <option value="1">納豆ごはん</option>
54
28
 
55
- <th><font>社員番号</font></th>
29
+ </select>
56
30
 
57
- <th><font>社員名</font></th>
31
+ <input type="submit" value="登録" />
58
32
 
59
- </tr>
33
+ </form>
60
-
61
- <logic:iterate id="syainData" name="syainList">
62
-
63
- <tr>
64
-
65
- <td><bean:write name="syainData" property="syainNumber" scope="request"/></td>
66
-
67
- <td style="text-align: left;"><bean:write name="syainData" property="syainName" scope="request"/></td>
68
-
69
- </tr>
70
-
71
- </logic:iterate>
72
-
73
- </table>
74
-
75
- <br>
76
-
77
- </div>
78
-
79
- </div>
80
34
 
81
35
  </body>
82
36
 
83
- </html:html>
37
+ </html>
84
-
85
-
86
-
87
-
88
-
89
- struts_config.xml
90
-
91
- <?xml version="1.0" encoding="ISO-8859-1" ?>
92
-
93
- <!DOCTYPE struts-config PUBLIC
94
-
95
- "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
96
-
97
- "http://struts.apache.org/dtds/struts-config_1_3.dtd">
98
-
99
- <struts-config>
100
-
101
- <form-beans>
102
-
103
- <form-bean type="form.SyainDataForm"
104
-
105
- name="SyainDataForm" />
106
-
107
- </form-beans>
108
-
109
-
110
-
111
-
112
-
113
- <!-- ========================================= Global Exception Definitions -->
114
-
115
-
116
-
117
- <global-exceptions>
118
-
119
- <!-- sample exception handler
120
-
121
- <exception
122
-
123
- key="expired.password"
124
-
125
- type="app.ExpiredPasswordException"
126
-
127
- path="/changePassword.jsp"/>
128
-
129
- end sample -->
130
-
131
- </global-exceptions>
132
-
133
-
134
-
135
-
136
-
137
- <!-- =========================================== Global Forward Definitions -->
138
-
139
-
140
-
141
- <global-forwards>
142
-
143
- <!-- Default forward to "Welcome" action -->
144
-
145
- <!-- Demonstrates using index.jsp to forward -->
146
-
147
- <forward
148
-
149
- name="welcome"
150
-
151
- path="/Welcome.do"/>
152
-
153
- </global-forwards>
154
-
155
-
156
-
157
-
158
-
159
- <!-- =========================================== Action Mapping Definitions -->
160
-
161
-
162
-
163
- <action-mappings>
164
-
165
- <!-- Default "Welcome" action -->
166
-
167
- <!-- Forwards to Welcome.jsp -->
168
-
169
- <action
170
-
171
- path="/Welcome"
172
-
173
- forward="/view/Search.jsp"/>
174
-
175
-
176
-
177
- <action type="action.SearchAction"
178
-
179
- path="/SearchActionPath"
180
-
181
- name="SyainDataForm"
182
-
183
- scope="request"
184
-
185
- validate="true"
186
-
187
- input="/view/Search.jsp">
188
-
189
-
190
-
191
- <forward name="success" path="/view/SyainData.jsp" />
192
-
193
- <forward name="err" path="/view/Search.jsp" />
194
-
195
- </action>
196
-
197
- </action-mappings>
198
-
199
-
200
-
201
-
202
-
203
- <!-- ======================================== Message Resources Definitions -->
204
-
205
-
206
-
207
- <message-resources parameter="MessageResources" />
208
-
209
-
210
-
211
-
212
-
213
- <!-- =============================================== Plug Ins Configuration -->
214
-
215
-
216
-
217
- <!-- ======================================================= Tiles plugin -->
218
-
219
- <!--
220
-
221
- This plugin initialize Tiles definition factory. This later can takes some
222
-
223
- parameters explained here after. The plugin first read parameters from
224
-
225
- web.xml, thenoverload them with parameters defined here. All parameters
226
-
227
- are optional.
228
-
229
- The plugin should be declared in each struts-config file.
230
-
231
- - definitions-config: (optional)
232
-
233
- Specify configuration file names. There can be several comma
234
-
235
- separated file names (default: ?? )
236
-
237
- - moduleAware: (optional - struts1.1)
238
-
239
- Specify if the Tiles definition factory is module aware. If true
240
-
241
- (default), there will be one factory for each Struts module.
242
-
243
- If false, there will be one common factory for all module. In this
244
-
245
- later case, it is still needed to declare one plugin per module.
246
-
247
- The factory will be initialized with parameters found in the first
248
-
249
- initialized plugin (generally the one associated with the default
250
-
251
- module).
252
-
253
- true : One factory per module. (default)
254
-
255
- false : one single shared factory for all modules
256
-
257
- - definitions-parser-validate: (optional)
258
-
259
- Specify if xml parser should validate the Tiles configuration file.
260
-
261
- true : validate. DTD should be specified in file header (default)
262
-
263
- false : no validation
264
-
265
-
266
-
267
- Paths found in Tiles definitions are relative to the main context.
268
-
269
-
270
-
271
- To use this plugin, download and add the Tiles jar to your WEB-INF/lib
272
-
273
- directory then uncomment the plugin definition below.
274
-
275
-
276
-
277
- <plug-in className="org.apache.struts.tiles.TilesPlugin" >
278
-
279
-
280
-
281
- <set-property property="definitions-config"
282
-
283
- value="/WEB-INF/tiles-defs.xml" />
284
-
285
- <set-property property="moduleAware" value="true" />
286
-
287
- </plug-in>
288
-
289
- -->
290
-
291
-
292
-
293
-
294
-
295
- <!-- =================================================== Validator plugin -->
296
-
297
-
298
-
299
- <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
300
-
301
- <set-property
302
-
303
- property="pathnames"
304
-
305
- value="/org/apache/struts/validator/validator-rules.xml,
306
-
307
- /WEB-INF/validation.xml"/>
308
-
309
- </plug-in>
310
-
311
-
312
-
313
- </struts-config>