質問編集履歴
16
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -326,7 +326,7 @@
|
|
326
326
|
|
327
327
|
>
|
328
328
|
|
329
|
-
|
329
|
+
```JSP
|
330
330
|
|
331
331
|
``lang-jsp```
|
332
332
|
|
@@ -342,7 +342,9 @@
|
|
342
342
|
|
343
343
|
> <bean:write name="MailForm2" property="address1"/>
|
344
344
|
|
345
|
+
```
|
346
|
+
|
345
|
-
|
347
|
+
Q.}がどこに必要なのか**
|
346
348
|
|
347
349
|
dispatch というハンドラパラメーターがありません
|
348
350
|
|
15
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
```lang-java```
|
6
6
|
|
7
|
+
```JAVA
|
8
|
+
|
7
9
|
**コード ここから-- **
|
8
10
|
|
9
11
|
|
@@ -18,7 +20,9 @@
|
|
18
20
|
|
19
21
|
map.put("firster","lookupDispatchA");
|
20
22
|
|
21
|
-
map.put("forgets","lookupDispatchB");
|
23
|
+
map.put("forgets","lookupDispatchB");入力中の内容をテンプレートとして保存
|
24
|
+
|
25
|
+
|
22
26
|
|
23
27
|
return map;
|
24
28
|
|
@@ -250,11 +254,17 @@
|
|
250
254
|
|
251
255
|
> /*****java action code ここまで**
|
252
256
|
|
257
|
+
```
|
258
|
+
|
253
|
-
>
|
259
|
+
>
|
254
|
-
|
260
|
+
|
255
|
-
>
|
261
|
+
>
|
262
|
+
|
256
|
-
|
263
|
+
> ```config.xml
|
264
|
+
|
257
|
-
|
265
|
+
```lang-config```
|
266
|
+
|
267
|
+
|
258
268
|
|
259
269
|
> <form-bean name="Mailform" type="action.form.Mailfrom"></form-bean>
|
260
270
|
|
@@ -308,13 +318,19 @@
|
|
308
318
|
|
309
319
|
> /**** config code ここまで*** `````````
|
310
320
|
|
321
|
+
```
|
322
|
+
|
311
|
-
>
|
323
|
+
>
|
312
|
-
|
324
|
+
|
313
|
-
>
|
325
|
+
>
|
314
|
-
|
326
|
+
|
315
|
-
>
|
327
|
+
>
|
328
|
+
|
316
|
-
|
329
|
+
>````JSP
|
330
|
+
|
317
|
-
|
331
|
+
``lang-jsp```
|
332
|
+
|
333
|
+
|
318
334
|
|
319
335
|
> ----1--
|
320
336
|
|
@@ -334,6 +350,8 @@
|
|
334
350
|
|
335
351
|
|
336
352
|
|
353
|
+
```
|
354
|
+
|
337
355
|
|
338
356
|
|
339
357
|
エラーを解決したいです
|
14
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
```lang-java
|
5
|
+
```lang-java```
|
6
6
|
|
7
7
|
**コード ここから-- **
|
8
8
|
|
@@ -254,7 +254,7 @@
|
|
254
254
|
|
255
255
|
>
|
256
256
|
|
257
|
-
>
|
257
|
+
> ```lang-config```
|
258
258
|
|
259
259
|
> <form-bean name="Mailform" type="action.form.Mailfrom"></form-bean>
|
260
260
|
|
@@ -314,7 +314,7 @@
|
|
314
314
|
|
315
315
|
>
|
316
316
|
|
317
|
-
>
|
317
|
+
>```lang-jsp```
|
318
318
|
|
319
319
|
> ----1--
|
320
320
|
|
13
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,25 +10,25 @@
|
|
10
10
|
|
11
11
|
> public class MailAction extends LookupDispatchAction {
|
12
12
|
|
13
|
-
|
13
|
+
protected Map getKeyMethodMap() {
|
14
|
-
|
14
|
+
|
15
|
-
|
15
|
+
// キーとメソッドの対応を登録する
|
16
|
-
|
16
|
+
|
17
|
-
|
17
|
+
Map<String,String> map = new HashMap<String,String>();
|
18
|
-
|
18
|
+
|
19
|
-
|
19
|
+
map.put("firster","lookupDispatchA");
|
20
|
-
|
20
|
+
|
21
|
-
|
21
|
+
map.put("forgets","lookupDispatchB");
|
22
|
-
|
22
|
+
|
23
|
-
|
23
|
+
return map;
|
24
|
-
|
24
|
+
|
25
|
-
|
25
|
+
}
|
26
|
-
|
27
|
-
|
26
|
+
|
28
|
-
|
29
|
-
|
27
|
+
|
30
|
-
|
31
|
-
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
32
|
|
33
33
|
> private String url="jdbc:mysql:localhost/####;
|
34
34
|
|
@@ -36,87 +36,83 @@
|
|
36
36
|
|
37
37
|
> private String pass = "";
|
38
38
|
|
39
|
-
|
39
|
+
|
40
|
-
|
41
|
-
|
40
|
+
|
41
|
+
|
42
42
|
|
43
43
|
> public ActionForward lookupDispatchA (ActionMapping mapping
|
44
44
|
|
45
|
-
|
45
|
+
,ActionForm form
|
46
|
-
|
46
|
+
|
47
|
-
|
47
|
+
,HttpServletRequest request
|
48
|
-
|
48
|
+
|
49
|
-
|
49
|
+
,HttpServletResponse response) throws Exception {
|
50
|
-
|
51
|
-
|
50
|
+
|
52
|
-
|
53
|
-
|
51
|
+
|
52
|
+
|
53
|
+
|
54
54
|
|
55
55
|
> Mailform frm = (Mailform)form;
|
56
56
|
|
57
|
-
|
57
|
+
String name = frm.getName();
|
58
|
-
|
58
|
+
|
59
|
-
|
59
|
+
String address = frm.getAddress();
|
60
|
-
|
60
|
+
|
61
|
-
|
61
|
+
String pwd = frm.getPwd();
|
62
|
-
|
63
|
-
|
62
|
+
|
64
|
-
|
65
|
-
|
63
|
+
|
64
|
+
|
65
|
+
|
66
66
|
|
67
67
|
> MailForm2 frm1 = (MailForm2)form;
|
68
68
|
|
69
69
|
> String address1 = frm1.getAddress1();
|
70
70
|
|
71
|
-
|
71
|
+
|
72
72
|
|
73
73
|
> //actionMessaages作成
|
74
74
|
|
75
|
-
|
75
|
+
ActionMessages errbox = new ActionMessages();
|
76
|
-
|
76
|
+
|
77
|
-
|
77
|
+
ActionMessage errmsg1 = new ActionMessage("errors.empty","未入力");
|
78
|
-
|
78
|
+
|
79
|
-
|
79
|
+
ActionMessage errmsg2 = new ActionMessage("errors.email","半角入力");
|
80
|
-
|
80
|
+
|
81
|
-
|
81
|
+
ActionMessage errmsg3= new ActionMessage("errors.already","既出");
|
82
|
-
|
82
|
+
|
83
|
-
|
83
|
+
ActionMessage errmsg4 = new ActionMessage("errors.unregist","未登録");
|
84
84
|
|
85
85
|
>
|
86
86
|
|
87
87
|
> if( name == null || address == null) {/*未入力*/
|
88
88
|
|
89
|
-
|
89
|
+
errbox.add("empty",errmsg1);}/*ActionMessage
|
90
|
-
|
90
|
+
|
91
|
-
|
91
|
+
(string、String>はダメ*/
|
92
|
-
|
93
|
-
|
92
|
+
|
93
|
+
|
94
94
|
|
95
95
|
> /*半角入力*/
|
96
96
|
|
97
|
-
|
97
|
+
if (address != "[\\d[a-zA-Z]*]+@[\\d[a-zA-Z]*]"){
|
98
|
-
|
98
|
+
|
99
|
-
> errbox.add("half",errmsg2);}
|
99
|
+
> errbox.add("half",errmsg2);}
|
100
|
-
|
101
|
-
>
|
102
100
|
|
103
101
|
>
|
104
102
|
|
105
103
|
> /*完了済み*/
|
106
104
|
|
107
|
-
|
105
|
+
if(address == address1) {
|
108
|
-
|
106
|
+
|
109
|
-
|
107
|
+
errbox.add("already",errmsg3); }
|
110
108
|
|
111
109
|
> /*未登録*/
|
112
110
|
|
113
111
|
> if(address1 !=address)
|
114
112
|
|
115
|
-
|
113
|
+
{
|
116
|
-
|
114
|
+
|
117
|
-
|
115
|
+
errbox.add("unregist",errmsg4);
|
118
|
-
|
119
|
-
>
|
120
116
|
|
121
117
|
>
|
122
118
|
|
12
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,325 +8,327 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
public class MailAction extends LookupDispatchAction {
|
12
|
-
|
13
|
-
protected Map getKeyMethodMap() {
|
14
|
-
|
15
|
-
// キーとメソッドの対応を登録する
|
16
|
-
|
17
|
-
Map<String,String> map = new HashMap<String,String>();
|
18
|
-
|
19
|
-
map.put("firster","lookupDispatchA");
|
20
|
-
|
21
|
-
map.put("forgets","lookupDispatchB");
|
22
|
-
|
23
|
-
return map;
|
24
|
-
|
25
|
-
}
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
private String url="jdbc:mysql:localhost/
|
34
|
-
|
35
|
-
private String user = "root";
|
36
|
-
|
37
|
-
private String pass = "";
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
public ActionForward lookupDispatchA (ActionMapping mapping
|
44
|
-
|
45
|
-
,ActionForm form
|
46
|
-
|
47
|
-
,HttpServletRequest request
|
48
|
-
|
49
|
-
,HttpServletResponse response) throws Exception {
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
String a
|
58
|
-
|
59
|
-
String
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
ActionMessage err
|
76
|
-
|
77
|
-
ActionMessage errmsg
|
78
|
-
|
79
|
-
ActionMessage errmsg
|
80
|
-
|
81
|
-
ActionMessage errmsg
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
e
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
/*
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
prop
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
prop.setProperty("mail.smtp.
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
new String
|
200
|
-
|
201
|
-
mimeMessage1.set
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
<action
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
<
|
288
|
-
|
289
|
-
path="/
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
p
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
11
|
+
> public class MailAction extends LookupDispatchAction {
|
12
|
+
|
13
|
+
> protected Map getKeyMethodMap() {
|
14
|
+
|
15
|
+
> // キーとメソッドの対応を登録する
|
16
|
+
|
17
|
+
> Map<String,String> map = new HashMap<String,String>();
|
18
|
+
|
19
|
+
> map.put("firster","lookupDispatchA");
|
20
|
+
|
21
|
+
> map.put("forgets","lookupDispatchB");
|
22
|
+
|
23
|
+
> return map;
|
24
|
+
|
25
|
+
> }
|
26
|
+
|
27
|
+
>
|
28
|
+
|
29
|
+
>
|
30
|
+
|
31
|
+
>
|
32
|
+
|
33
|
+
> private String url="jdbc:mysql:localhost/####;
|
34
|
+
|
35
|
+
> private String user = "root";
|
36
|
+
|
37
|
+
> private String pass = "";
|
38
|
+
|
39
|
+
>
|
40
|
+
|
41
|
+
>
|
42
|
+
|
43
|
+
> public ActionForward lookupDispatchA (ActionMapping mapping
|
44
|
+
|
45
|
+
> ,ActionForm form
|
46
|
+
|
47
|
+
> ,HttpServletRequest request
|
48
|
+
|
49
|
+
> ,HttpServletResponse response) throws Exception {
|
50
|
+
|
51
|
+
>
|
52
|
+
|
53
|
+
>
|
54
|
+
|
55
|
+
> Mailform frm = (Mailform)form;
|
56
|
+
|
57
|
+
> String name = frm.getName();
|
58
|
+
|
59
|
+
> String address = frm.getAddress();
|
60
|
+
|
61
|
+
> String pwd = frm.getPwd();
|
62
|
+
|
63
|
+
>
|
64
|
+
|
65
|
+
>
|
66
|
+
|
67
|
+
> MailForm2 frm1 = (MailForm2)form;
|
68
|
+
|
69
|
+
> String address1 = frm1.getAddress1();
|
70
|
+
|
71
|
+
>
|
72
|
+
|
73
|
+
> //actionMessaages作成
|
74
|
+
|
75
|
+
> ActionMessages errbox = new ActionMessages();
|
76
|
+
|
77
|
+
> ActionMessage errmsg1 = new ActionMessage("errors.empty","未入力");
|
78
|
+
|
79
|
+
> ActionMessage errmsg2 = new ActionMessage("errors.email","半角入力");
|
80
|
+
|
81
|
+
> ActionMessage errmsg3= new ActionMessage("errors.already","既出");
|
82
|
+
|
83
|
+
> ActionMessage errmsg4 = new ActionMessage("errors.unregist","未登録");
|
84
|
+
|
85
|
+
>
|
86
|
+
|
87
|
+
> if( name == null || address == null) {/*未入力*/
|
88
|
+
|
89
|
+
> errbox.add("empty",errmsg1);}/*ActionMessage
|
90
|
+
|
91
|
+
> (string、String>はダメ*/
|
92
|
+
|
93
|
+
>
|
94
|
+
|
95
|
+
> /*半角入力*/
|
96
|
+
|
97
|
+
> if (address != "[\\d[a-zA-Z]*]+@[\\d[a-zA-Z]*]"){
|
98
|
+
|
99
|
+
> errbox.add("half",errmsg2);}
|
100
|
+
|
101
|
+
>
|
102
|
+
|
103
|
+
>
|
104
|
+
|
105
|
+
> /*完了済み*/
|
106
|
+
|
107
|
+
> if(address == address1) {
|
108
|
+
|
109
|
+
> errbox.add("already",errmsg3); }
|
110
|
+
|
111
|
+
> /*未登録*/
|
112
|
+
|
113
|
+
> if(address1 !=address)
|
114
|
+
|
115
|
+
> {
|
116
|
+
|
117
|
+
> errbox.add("unregist",errmsg4);
|
118
|
+
|
119
|
+
>
|
120
|
+
|
121
|
+
>
|
122
|
+
|
123
|
+
>
|
124
|
+
|
125
|
+
>
|
126
|
+
|
127
|
+
> saveErrors(request,errbox);
|
128
|
+
|
129
|
+
>
|
130
|
+
|
131
|
+
> }
|
132
|
+
|
133
|
+
> /*configのsource取得*/
|
134
|
+
|
135
|
+
>
|
136
|
+
|
137
|
+
> DB**** db = new DB******();
|
138
|
+
|
139
|
+
> db.getDBConnection(url,user,pass);
|
140
|
+
|
141
|
+
>
|
142
|
+
|
143
|
+
> db.seldb(address);/*登録者かどうか検索*/
|
144
|
+
|
145
|
+
> db.insdb(name, address);/*登録*/
|
146
|
+
|
147
|
+
>
|
148
|
+
|
149
|
+
> /*メール送信*/
|
150
|
+
|
151
|
+
>
|
152
|
+
|
153
|
+
>
|
154
|
+
|
155
|
+
> try{/*start*/
|
156
|
+
|
157
|
+
> //property
|
158
|
+
|
159
|
+
> Properties prop = new Properties();
|
160
|
+
|
161
|
+
> prop.setProperty("mail.smtp.host", "localhost");
|
162
|
+
|
163
|
+
> //SMTPサーバーのセット
|
164
|
+
|
165
|
+
> prop.setProperty("mail.smtp.port", "25");
|
166
|
+
|
167
|
+
>
|
168
|
+
|
169
|
+
> //メールセッションを確立
|
170
|
+
|
171
|
+
> Session session = Session.getInstance(prop);
|
172
|
+
|
173
|
+
>
|
174
|
+
|
175
|
+
> //送信メッセージ
|
176
|
+
|
177
|
+
> MimeMessage mimeMessage1 = new MimeMessage(session);
|
178
|
+
|
179
|
+
>
|
180
|
+
|
181
|
+
>
|
182
|
+
|
183
|
+
> //ToAddressのセット
|
184
|
+
|
185
|
+
> InternetAddress toAddress =new InternetAddress("***@****.co.jp","ゲストさん");
|
186
|
+
|
187
|
+
> mimeMessage1.setRecipient(Message.RecipientType.TO,toAddress);
|
188
|
+
|
189
|
+
>
|
190
|
+
|
191
|
+
> //FRomAdressnoセット
|
192
|
+
|
193
|
+
> InternetAddress fromAddress = new InternetAddress("***@****.co.jp","管理者");
|
194
|
+
|
195
|
+
> mimeMessage1.setFrom(fromAddress);
|
196
|
+
|
197
|
+
>
|
198
|
+
|
199
|
+
> new String("Subject");
|
200
|
+
|
201
|
+
> mimeMessage1.setSubject("パスワード発行","iso-2022-jp");/*件名*/
|
202
|
+
|
203
|
+
> new String ("Text");
|
204
|
+
|
205
|
+
> mimeMessage1.setText("あなたのパスワードは" + pwd + "です","iso-2022-jp");
|
206
|
+
|
207
|
+
>
|
208
|
+
|
209
|
+
> //保存
|
210
|
+
|
211
|
+
> mimeMessage1.saveChanges();
|
212
|
+
|
213
|
+
>
|
214
|
+
|
215
|
+
>
|
216
|
+
|
217
|
+
> //メールの送信
|
218
|
+
|
219
|
+
> Transport.send(mimeMessage1);
|
220
|
+
|
221
|
+
> }catch(MessagingException e){/*すべての例外*/
|
222
|
+
|
223
|
+
> e.printStackTrace();
|
224
|
+
|
225
|
+
> return null;
|
226
|
+
|
227
|
+
> }
|
228
|
+
|
229
|
+
>
|
230
|
+
|
231
|
+
>
|
232
|
+
|
233
|
+
> /*configのsource取得*/
|
234
|
+
|
235
|
+
>
|
236
|
+
|
237
|
+
>
|
238
|
+
|
239
|
+
> db.throwDBConnection(); /*切断*/
|
240
|
+
|
241
|
+
> return mapping.findForward("first");
|
242
|
+
|
243
|
+
>
|
244
|
+
|
245
|
+
> }
|
246
|
+
|
247
|
+
>
|
248
|
+
|
249
|
+
> public ActionForward lookupDispatchB(ActionMapping mapping,
|
250
|
+
|
251
|
+
> ※以下の処理はLookup dispatchAと同じ
|
252
|
+
|
253
|
+
> } ← **※ここでエラーが }が足らないと出ています**
|
254
|
+
|
255
|
+
> /*****java action code ここまで**
|
256
|
+
|
257
|
+
>
|
258
|
+
|
259
|
+
>
|
260
|
+
|
261
|
+
> /***config code はここから****/
|
262
|
+
|
263
|
+
> <form-bean name="Mailform" type="action.form.Mailfrom"></form-bean>
|
264
|
+
|
265
|
+
> <form-bean name="Mailform1" type="action.form.MailForm2"></form-bean>
|
266
|
+
|
267
|
+
>
|
268
|
+
|
269
|
+
> <action
|
270
|
+
|
271
|
+
> path="/MailAction"
|
272
|
+
|
273
|
+
> type="action.MailAction"
|
274
|
+
|
275
|
+
> name="Mailform"
|
276
|
+
|
277
|
+
> input="passInput.jsp"
|
278
|
+
|
279
|
+
> scope="request"
|
280
|
+
|
281
|
+
>
|
282
|
+
|
283
|
+
> validate="true"
|
284
|
+
|
285
|
+
> parameter="dispatch">
|
286
|
+
|
287
|
+
> <!-- 1 -->
|
288
|
+
|
289
|
+
> <forward name="first" path="/jsp/passInput.jsp"/></action>
|
290
|
+
|
291
|
+
> <action
|
292
|
+
|
293
|
+
> path="/MailAction"
|
294
|
+
|
295
|
+
> type="action.MailAction"
|
296
|
+
|
297
|
+
> name="MailForm2"
|
298
|
+
|
299
|
+
> input="passInput.jsp"
|
300
|
+
|
301
|
+
> scope="request"
|
302
|
+
|
303
|
+
> parameter="dispatch"
|
304
|
+
|
305
|
+
> validate="true">
|
306
|
+
|
307
|
+
> <!-- 2 -->
|
308
|
+
|
309
|
+
> <forward name="forget" path="/jsp/passInput.jsp"/>
|
310
|
+
|
311
|
+
>
|
312
|
+
|
313
|
+
> /**** config code ここまで*** `````````
|
314
|
+
|
315
|
+
>
|
316
|
+
|
317
|
+
>
|
318
|
+
|
319
|
+
>
|
320
|
+
|
321
|
+
> /*** jsp ***/
|
322
|
+
|
323
|
+
> ----1--
|
324
|
+
|
325
|
+
> <bean:write name="Mailform" property="address"/>
|
326
|
+
|
327
|
+
>
|
328
|
+
|
329
|
+
> ---2--
|
330
|
+
|
331
|
+
> <bean:write name="MailForm2" property="address1"/>
|
330
332
|
|
331
333
|
**Q.}がどこに必要なのか**
|
332
334
|
|
11
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
```lang-java
|
6
|
+
|
5
|
-
|
7
|
+
**コード ここから-- **
|
6
8
|
|
7
9
|
|
8
10
|
|
@@ -246,13 +248,13 @@
|
|
246
248
|
|
247
249
|
} ← **※ここでエラーが }が足らないと出ています**
|
248
250
|
|
249
|
-
/*****java action code ここまで*
|
251
|
+
/*****java action code ここまで**
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
255
|
-
/*config code はここから**/
|
257
|
+
/***config code はここから****/
|
256
258
|
|
257
259
|
<form-bean name="Mailform" type="action.form.Mailfrom"></form-bean>
|
258
260
|
|
@@ -326,7 +328,7 @@
|
|
326
328
|
|
327
329
|
|
328
330
|
|
329
|
-
Q.}がどこに必要なのか
|
331
|
+
**Q.}がどこに必要なのか**
|
330
332
|
|
331
333
|
dispatch というハンドラパラメーターがありません
|
332
334
|
|
10
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
```lang-java コード ここから--
|
5
|
+
```lang-java コード ここから-- `````````
|
6
6
|
|
7
7
|
|
8
8
|
|
9
バックくおーと追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -246,7 +246,7 @@
|
|
246
246
|
|
247
247
|
} ← **※ここでエラーが }が足らないと出ています**
|
248
248
|
|
249
|
-
/*****java action code ここまで*/
|
249
|
+
/*****java action code ここまで*/``````````
|
250
250
|
|
251
251
|
|
252
252
|
|
@@ -304,7 +304,7 @@
|
|
304
304
|
|
305
305
|
|
306
306
|
|
307
|
-
/**** config code ここまで***
|
307
|
+
/**** config code ここまで*** `````````
|
308
308
|
|
309
309
|
|
310
310
|
|
8
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -326,7 +326,7 @@
|
|
326
326
|
|
327
327
|
|
328
328
|
|
329
|
-
|
329
|
+
Q.}がどこに必要なのか
|
330
330
|
|
331
331
|
dispatch というハンドラパラメーターがありません
|
332
332
|
|
@@ -338,6 +338,4 @@
|
|
338
338
|
|
339
339
|
エラーを解決したいです
|
340
340
|
|
341
|
-
|
342
|
-
|
343
|
-
|
341
|
+
どのように直せばよいでしょうか
|
7
}取り除いた
test
CHANGED
File without changes
|
test
CHANGED
@@ -240,7 +240,7 @@
|
|
240
240
|
|
241
241
|
|
242
242
|
|
243
|
-
public ActionForward lookupDispatchB(ActionMapping mapping,
|
243
|
+
public ActionForward lookupDispatchB(ActionMapping mapping,
|
244
244
|
|
245
245
|
※以下の処理はLookup dispatchAと同じ
|
246
246
|
|
6
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -322,7 +322,7 @@
|
|
322
322
|
|
323
323
|
---2--
|
324
324
|
|
325
|
-
<bean:write name="Mail
|
325
|
+
<bean:write name="MailForm2" property="address1"/>
|
326
326
|
|
327
327
|
|
328
328
|
|
5
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,6 +6,38 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
public class MailAction extends LookupDispatchAction {
|
10
|
+
|
11
|
+
protected Map getKeyMethodMap() {
|
12
|
+
|
13
|
+
// キーとメソッドの対応を登録する
|
14
|
+
|
15
|
+
Map<String,String> map = new HashMap<String,String>();
|
16
|
+
|
17
|
+
map.put("firster","lookupDispatchA");
|
18
|
+
|
19
|
+
map.put("forgets","lookupDispatchB");
|
20
|
+
|
21
|
+
return map;
|
22
|
+
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
private String url="jdbc:mysql:localhost/*****";
|
32
|
+
|
33
|
+
private String user = "root";
|
34
|
+
|
35
|
+
private String pass = "";
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
9
41
|
public ActionForward lookupDispatchA (ActionMapping mapping
|
10
42
|
|
11
43
|
,ActionForm form
|
4
個人情報削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
|
99
|
-
DB
|
99
|
+
DB**** db = new DB******();
|
100
100
|
|
101
101
|
db.getDBConnection(url,user,pass);
|
102
102
|
|
3
jsp追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -276,6 +276,24 @@
|
|
276
276
|
|
277
277
|
|
278
278
|
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
/*** jsp ***/
|
284
|
+
|
285
|
+
----1--
|
286
|
+
|
287
|
+
<bean:write name="Mailform" property="address"/>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
---2--
|
292
|
+
|
293
|
+
<bean:write name="Mailform" property="address"/>
|
294
|
+
|
295
|
+
|
296
|
+
|
279
297
|
**Q.}がどこに必要なのか
|
280
298
|
|
281
299
|
dispatch というハンドラパラメーターがありません
|
2
エラーの位置掲載
test
CHANGED
File without changes
|
test
CHANGED
@@ -208,11 +208,11 @@
|
|
208
208
|
|
209
209
|
|
210
210
|
|
211
|
-
public ActionForward lookupDispatchB(ActionMapping mapping,
|
211
|
+
public ActionForward lookupDispatchB(ActionMapping mapping, }
|
212
|
-
|
212
|
+
|
213
|
-
※以下の処理はLookup dispatchAと同じ
|
213
|
+
※以下の処理はLookup dispatchAと同じ
|
214
|
-
|
214
|
+
|
215
|
-
}
|
215
|
+
} ← **※ここでエラーが }が足らないと出ています**
|
216
216
|
|
217
217
|
/*****java action code ここまで*/
|
218
218
|
|
1
見やすくしました
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
サンプルコードを一部載せました
|
2
|
+
|
3
|
+
|
4
|
+
|
1
5
|
```lang-java コード ここから--
|
2
6
|
|
3
7
|
|
@@ -272,13 +276,17 @@
|
|
272
276
|
|
273
277
|
|
274
278
|
|
275
|
-
Q.}がどこに必要なのか
|
279
|
+
**Q.}がどこに必要なのか
|
276
280
|
|
277
281
|
dispatch というハンドラパラメーターがありません
|
278
282
|
|
279
|
-
beanのform2が見当たらないとでて困っています
|
283
|
+
beanのform2が見当たらないとでて困っています**
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
280
|
-
|
289
|
+
エラーを解決したいです
|
281
|
-
|
282
290
|
|
283
291
|
|
284
292
|
|