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

質問編集履歴

3

修正

2020/11/26 00:23

投稿

EDM
EDM

スコア30

title CHANGED
File without changes
body CHANGED
@@ -63,13 +63,13 @@
63
63
  @Qualifier (value="sampleBean")
64
64
  protected SampleBean sampleBean;
65
65
 
66
- **@RequestMapping(value="index",method=RequestMethod.GET)
66
+ @RequestMapping(value="index",method=RequestMethod.GET)
67
67
  public ModelAndView index()
68
68
  {
69
69
  ModelAndView mv = new ModelAndView("index");
70
70
  mv.addObject("sampleBean", new SampleBean());
71
71
  return mv;
72
- }**
72
+ }
73
73
 
74
74
  // index.jspにてsubmit
75
75
  @RequestMapping ( value="confirm" , method=RequestMethod.POST )

2

修正

2020/11/26 00:23

投稿

EDM
EDM

スコア30

title CHANGED
File without changes
body CHANGED
@@ -63,6 +63,14 @@
63
63
  @Qualifier (value="sampleBean")
64
64
  protected SampleBean sampleBean;
65
65
 
66
+ **@RequestMapping(value="index",method=RequestMethod.GET)
67
+ public ModelAndView index()
68
+ {
69
+ ModelAndView mv = new ModelAndView("index");
70
+ mv.addObject("sampleBean", new SampleBean());
71
+ return mv;
72
+ }**
73
+
66
74
  // index.jspにてsubmit
67
75
  @RequestMapping ( value="confirm" , method=RequestMethod.POST )
68
76
  public ModelAndView confirm

1

修正

2020/11/26 00:23

投稿

EDM
EDM

スコア30

title CHANGED
File without changes
body CHANGED
@@ -3,11 +3,17 @@
3
3
  流れとして
4
4
  入力画面で入力後submitして確認画面に画面遷移します。そこで入力内容を確認できます。その際、入力内容を修正するため戻るボタンを押して入力画面に戻った時、テキストボックスには入力した内容が表示されているものの、プルダウンが"-----"になってしまいます。
5
5
 
6
- 入力画面 タロウ / りんご で次へ
6
+ 入力画面 タロウ / オレンジ で次へ
7
- 確認画面では タロウ / りんごが表示 戻る
7
+ 確認画面では タロウ / オレンジ が表示 戻る
8
8
  入力画面 タロウ /  ------ こうなるのです。
9
9
 
10
10
  コードは必要部分のみ抜粋 complete.jspは省きます。
11
+
12
+ 補足質問
13
+ -----については初期値として使いたいのですが、それは
14
+ <option value="" selected>-----</option>
15
+ でよいのでしょうか?
16
+
11
17
  ```index
12
18
  <form:form modelAttribute="sampleBean"
13
19
  action="confirm.htm" method="POST">