質問編集履歴

3

Actionクラス

2016/07/12 00:08

投稿

settyan
settyan

スコア60

test CHANGED
File without changes
test CHANGED
@@ -291,3 +291,281 @@
291
291
  のような形で生成されているので生成ミスではないと思うのですが。
292
292
 
293
293
  ご教授のほうよろしくお願いします。
294
+
295
+
296
+
297
+ **Actionクラス**
298
+
299
+ ---
300
+
301
+ ```java
302
+
303
+
304
+
305
+ package action;
306
+
307
+
308
+
309
+ import java.text.SimpleDateFormat;
310
+
311
+ import java.util.ArrayList;
312
+
313
+ import java.util.Calendar;
314
+
315
+ import java.util.Date;
316
+
317
+ import java.util.List;
318
+
319
+
320
+
321
+ import org.apache.struts2.config.Result;
322
+
323
+ import org.apache.struts2.config.Results;
324
+
325
+ import org.apache.struts2.dispatcher.ServletRedirectResult;
326
+
327
+
328
+
329
+ import bean.DivisionCodeBean;
330
+
331
+ import bean.MonthBean;
332
+
333
+ import bean.PushInfoBean;
334
+
335
+ import bean.RecipientBean;
336
+
337
+
338
+
339
+ import com.opensymphony.xwork2.ActionChainResult;
340
+
341
+
342
+
343
+ import dao.DivisionCodeDAO;
344
+
345
+ import dao.PushInsertDAO;
346
+
347
+ import dao.RecipientDAO;
348
+
349
+
350
+
351
+
352
+
353
+ @Results({
354
+
355
+ @Result(name = "pv", value = "pV", type = ActionChainResult.class),
356
+
357
+ @Result(name = "psa", value = "pS", type=ServletRedirectResult.class)
358
+
359
+ })
360
+
361
+
362
+
363
+ public class PSA extends AbstractAction {
364
+
365
+ private static final long serialVersionUID = 1L;
366
+
367
+
368
+
369
+
370
+
371
+ //メンバー郡
372
+
373
+ public String Id;
374
+
375
+ public String pass;
376
+
377
+ public String code;
378
+
379
+ public int s_code = 0;
380
+
381
+ public String year;
382
+
383
+ public String month;
384
+
385
+ public String date;
386
+
387
+ public String errmsg;
388
+
389
+ public String hon;
390
+
391
+
392
+
393
+ //今日の日付取得
394
+
395
+ Calendar cal = Calendar.getInstance();
396
+
397
+ Date now = new Date();
398
+
399
+ SimpleDateFormat sdf1 = new SimpleDateFormat("YYYY/MM");
400
+
401
+ String nowdate= sdf1.format(now);
402
+
403
+
404
+
405
+ public String Name;
406
+
407
+
408
+
409
+
410
+
411
+ public String execute() throws Exception {
412
+
413
+
414
+
415
+ if((this.rList) == null){
416
+
417
+ System.out.println("null");
418
+
419
+ }else{
420
+
421
+ System.out.println("Notnull");
422
+
423
+ }
424
+
425
+
426
+
427
+ this.LoginName = (String)this.sessionMap.get("Name");
428
+
429
+ this.userId = (String)this.sessionMap.get("Id");
430
+
431
+
432
+
433
+ DDAO dcDAO = new DDAO();
434
+
435
+ dcBean = dcDAO.getDC();
436
+
437
+ pC = dcBean.getDList();
438
+
439
+
440
+
441
+ if(this.division_code == null){
442
+
443
+ RDAO rDAO = new RDAO();
444
+
445
+ rBean = rDAO.getData_R();
446
+
447
+ pR = rBean.getRDate_List();
448
+
449
+ }else{
450
+
451
+ RDAO rDAO = new RDAO();
452
+
453
+ s_d_code = Integer.parseInt(this.d_code);
454
+
455
+ if(s_d_code == 0){
456
+
457
+ rBean = rDAO.getData_R();
458
+
459
+
460
+
461
+ }else{
462
+
463
+ rBean = rDAO.getData_R(s_d_code);
464
+
465
+ }
466
+
467
+ pR = rBean.getRtDate_List();
468
+
469
+ }
470
+
471
+ return "success";
472
+
473
+ }
474
+
475
+
476
+
477
+ public String search() throws Exception {
478
+
479
+ return "pv";
480
+
481
+ }
482
+
483
+
484
+
485
+ public String debug() throws Exception {
486
+
487
+ if((this.rList) == null){
488
+
489
+ System.out.println("null");
490
+
491
+ }else{
492
+
493
+ System.out.println("Notnull");
494
+
495
+ }
496
+
497
+ return "success";
498
+
499
+ }
500
+
501
+
502
+
503
+
504
+
505
+ @SuppressWarnings("unchecked")
506
+
507
+ public String s() throws Exception {
508
+
509
+
510
+
511
+ RDAO rDAO = new RDAO();
512
+
513
+ s_d_code = Integer.parseInt(this.d_code);
514
+
515
+
516
+
517
+ if(s_d_code == 0){
518
+
519
+ rBean = rDAO.getData_R();
520
+
521
+ }else{
522
+
523
+ rBean = rDAO.getData_R(s_n_code);
524
+
525
+ }
526
+
527
+ pR = rBean.getRDate_List();
528
+
529
+
530
+
531
+ PIDAO pDAO = new PIDAO();
532
+
533
+ pDAO.iP(103, this.hon, pR);
534
+
535
+
536
+
537
+
538
+
539
+ this.errmsg = "qqqqqq";
540
+
541
+ return "psa";
542
+
543
+ }
544
+
545
+
546
+
547
+ public DBean getModeler1() {return dcBean;}
548
+
549
+ public ArrayList<DCBean> getLister1(){return pC;}
550
+
551
+ public void setLister1(ArrayList<DCBean> lister1) {this.pC = lister1;}
552
+
553
+
554
+
555
+ public RBean getModeler() {return rBean;}
556
+
557
+ public ArrayList<RBean> getLister2(){return pR;}
558
+
559
+ public void setLister2(ArrayList<RBean> lister2) {this.pR = lister2;}
560
+
561
+
562
+
563
+ //リストグループ取得用
564
+
565
+ private List<String> rList;
566
+
567
+ public List<String> getrList() {return rList;}
568
+
569
+ public void setrList(List<String> rList) {this.rList = rList;}
570
+
571
+ ```

2

ミスの修正

2016/07/12 00:08

投稿

settyan
settyan

スコア60

test CHANGED
File without changes
test CHANGED
@@ -212,7 +212,7 @@
212
212
 
213
213
 
214
214
 
215
- <h2>PUSH送信画面</h2>
215
+ <h2>画面</h2>
216
216
 
217
217
  <font color="red"><b><s:property value="errmsg" /></b></font>
218
218
 
@@ -288,6 +288,6 @@
288
288
 
289
289
 
290
290
 
291
- のような形で生成されているので生成ミスではナイト思うのですが。
291
+ のような形で生成されているので生成ミスではないと思うのですが。
292
292
 
293
293
  ご教授のほうよろしくお願いします。

1

改修点の追加

2016/07/11 02:54

投稿

settyan
settyan

スコア60

test CHANGED
File without changes
test CHANGED
@@ -197,3 +197,97 @@
197
197
  htmlは初心者のため、できれば詳しい説明をしていただけるとうれしいです。
198
198
 
199
199
  どうかよろしくお願いします。
200
+
201
+
202
+
203
+ **改修点**
204
+
205
+ ---
206
+
207
+ ```html
208
+
209
+
210
+
211
+ <div id="tab1" class="tab">
212
+
213
+
214
+
215
+ <h2>PUSH送信画面</h2>
216
+
217
+ <font color="red"><b><s:property value="errmsg" /></b></font>
218
+
219
+ <div class="ib-box" style="padding-right: 50px; padding-left: 10px;">あああ</div>
220
+
221
+
222
+
223
+ <!-- その他処理-->
224
+
225
+
226
+
227
+ <!-- ボタン郡 -->
228
+
229
+ <div class="ib-box">
230
+
231
+ <div class="buttonGroup">
232
+
233
+ <s:submit method="debug" value="削除" />
234
+
235
+ </div>
236
+
237
+ </div>
238
+
239
+
240
+
241
+ <!-- 右側リスト -->
242
+
243
+ <div class="ib-box">
244
+
245
+ <form name="recipientList" action="">
246
+
247
+ <input type="submit" value="送信" />
248
+
249
+ <select id="rList" name="rList" multiple style="width: 140px;" size="10">
250
+
251
+ </select>
252
+
253
+ </form>
254
+
255
+ </div>
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+ <s:form name="mit" onSubmit="return check()">
264
+
265
+ <!-- その他処理-->
266
+
267
+ </s:form>
268
+
269
+ </div>
270
+
271
+ ```
272
+
273
+ 上記のようにしましたが依然Nullが返ってきてしまいます。
274
+
275
+
276
+
277
+ F12キーで確認してみると、
278
+
279
+ ```html
280
+
281
+ <select id="rList" name="rList" multiple style="width: 140px;" size="10">
282
+
283
+ <option value="value値">田中太郎</option>
284
+
285
+ </select>
286
+
287
+ ```
288
+
289
+
290
+
291
+ のような形で生成されているので生成ミスではナイト思うのですが。
292
+
293
+ ご教授のほうよろしくお願いします。