teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

hhhhhhhhhhhh

2016/05/05 08:27

投稿

diiko
diiko

スコア8

title CHANGED
File without changes
body CHANGED
@@ -1,157 +1,19 @@
1
- strutsを使用し社員検索画面を作成しているのですが、jsp側で検索した結果を取得すると格納されていたデータがなくなっています、どうすればいいでしょうか?
2
- デバッグしてみるとサーブレット側でフォームに格納しているところまでは確認できています。
3
-
4
- 宜しくお願いします。
5
-
6
- jsp
7
- <%@ page contentType="text/html; charset=Windows-31J"%>
8
- <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
9
- <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
10
- <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
11
- <%@ page import="java.util.List" %>
1
+ <!DOCTYPE html>
12
- <%@ page import="form.SyainDataForm"%>
13
-
14
- <html:html>
2
+ <html>
15
3
  <head>
16
- <meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
17
- <title>社員情報一覧画面</title>
5
+ <title>アンケート調査</title>
18
- <LINK href="./view/css/Common.css" rel="stylesheet" type="text/css">
19
6
  </head>
20
7
  <body>
21
- <div class="main">
22
- <h1>【社員情報一覧】</h1>
8
+ <h1>アンケート調査</h1>
23
- <bean:define id="syainList" name="SyainDataForm" property="searchResultList" type="java.util.List" scope="request"/>
9
+ <form method="POST" action="Quest1.jsp">
10
+ ●あなたの好きな食べ物は?
24
- <div class="list">
11
+ <select name="food">
25
- <font><%=syainList.size() %></font>
12
+ <option value="3">ラーメン</option>
26
- <table border=1 >
27
- <tr>
28
- <th><font>社員番号</font></th>
29
- <th><font>社員名</font></th>
13
+ <option value="2">カレーライス</option>
14
+ <option value="1">納豆ごはん</option>
15
+ </select>
16
+ <input type="submit" value="登録" />
30
- </tr>
17
+ </form>
31
- <logic:iterate id="syainData" name="syainList">
32
- <tr>
33
- <td><bean:write name="syainData" property="syainNumber" scope="request"/></td>
34
- <td style="text-align: left;"><bean:write name="syainData" property="syainName" scope="request"/></td>
35
- </tr>
36
- </logic:iterate>
37
- </table>
38
- <br>
39
- </div>
40
- </div>
41
18
  </body>
42
- </html:html>
19
+ </html>
43
-
44
-
45
- struts_config.xml
46
- <?xml version="1.0" encoding="ISO-8859-1" ?>
47
- <!DOCTYPE struts-config PUBLIC
48
- "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
49
- "http://struts.apache.org/dtds/struts-config_1_3.dtd">
50
- <struts-config>
51
- <form-beans>
52
- <form-bean type="form.SyainDataForm"
53
- name="SyainDataForm" />
54
- </form-beans>
55
-
56
-
57
- <!-- ========================================= Global Exception Definitions -->
58
-
59
- <global-exceptions>
60
- <!-- sample exception handler
61
- <exception
62
- key="expired.password"
63
- type="app.ExpiredPasswordException"
64
- path="/changePassword.jsp"/>
65
- end sample -->
66
- </global-exceptions>
67
-
68
-
69
- <!-- =========================================== Global Forward Definitions -->
70
-
71
- <global-forwards>
72
- <!-- Default forward to "Welcome" action -->
73
- <!-- Demonstrates using index.jsp to forward -->
74
- <forward
75
- name="welcome"
76
- path="/Welcome.do"/>
77
- </global-forwards>
78
-
79
-
80
- <!-- =========================================== Action Mapping Definitions -->
81
-
82
- <action-mappings>
83
- <!-- Default "Welcome" action -->
84
- <!-- Forwards to Welcome.jsp -->
85
- <action
86
- path="/Welcome"
87
- forward="/view/Search.jsp"/>
88
-
89
- <action type="action.SearchAction"
90
- path="/SearchActionPath"
91
- name="SyainDataForm"
92
- scope="request"
93
- validate="true"
94
- input="/view/Search.jsp">
95
-
96
- <forward name="success" path="/view/SyainData.jsp" />
97
- <forward name="err" path="/view/Search.jsp" />
98
- </action>
99
- </action-mappings>
100
-
101
-
102
- <!-- ======================================== Message Resources Definitions -->
103
-
104
- <message-resources parameter="MessageResources" />
105
-
106
-
107
- <!-- =============================================== Plug Ins Configuration -->
108
-
109
- <!-- ======================================================= Tiles plugin -->
110
- <!--
111
- This plugin initialize Tiles definition factory. This later can takes some
112
- parameters explained here after. The plugin first read parameters from
113
- web.xml, thenoverload them with parameters defined here. All parameters
114
- are optional.
115
- The plugin should be declared in each struts-config file.
116
- - definitions-config: (optional)
117
- Specify configuration file names. There can be several comma
118
- separated file names (default: ?? )
119
- - moduleAware: (optional - struts1.1)
120
- Specify if the Tiles definition factory is module aware. If true
121
- (default), there will be one factory for each Struts module.
122
- If false, there will be one common factory for all module. In this
123
- later case, it is still needed to declare one plugin per module.
124
- The factory will be initialized with parameters found in the first
125
- initialized plugin (generally the one associated with the default
126
- module).
127
- true : One factory per module. (default)
128
- false : one single shared factory for all modules
129
- - definitions-parser-validate: (optional)
130
- Specify if xml parser should validate the Tiles configuration file.
131
- true : validate. DTD should be specified in file header (default)
132
- false : no validation
133
-
134
- Paths found in Tiles definitions are relative to the main context.
135
-
136
- To use this plugin, download and add the Tiles jar to your WEB-INF/lib
137
- directory then uncomment the plugin definition below.
138
-
139
- <plug-in className="org.apache.struts.tiles.TilesPlugin" >
140
-
141
- <set-property property="definitions-config"
142
- value="/WEB-INF/tiles-defs.xml" />
143
- <set-property property="moduleAware" value="true" />
144
- </plug-in>
145
- -->
146
-
147
-
148
- <!-- =================================================== Validator plugin -->
149
-
150
- <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
151
- <set-property
152
- property="pathnames"
153
- value="/org/apache/struts/validator/validator-rules.xml,
154
- /WEB-INF/validation.xml"/>
155
- </plug-in>
156
-
157
- </struts-config>