- - PR -
htmlタグライブラリのcancelについて
1
投稿者 | 投稿内容 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
投稿日時: 2004-11-10 21:06
2度目の投稿です。
使用している環境は以下の通りです。 WindowsXPPro SP2 Tomcat 5.0.29 JDK 1.4.2_06 Struts 1.2.4 struts1.2.4でJSPを製造しているのですが、 htmlタグライブラリのcancelタグをJSP内のボタンに 割り当てているのですが、validateが回避できません。 *** JSP *** <html:cancel property="button5" value="一覧に戻る" /> <html:submit property="button1" value="入力完了" /> <html:reset property="button2" value="初期状態に戻す" /> *** struts-config.xml *** <action name="LogonForm1" path="/logon1" scope="request" type="Men.Tan.action.LogonAction1" input="/jsp/logon1.jsp" validate="true" > <forward name="form2" path="/jsp/logon2.jsp" /> <forward name="list" path="/jsp/logon0.jsp" /> <forward name="form1" path="/jsp/logon1.jsp" /> </action> *** Men.Tan.action.LogonAction1.java *** public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if( request.getParameter("button5") != null ) { return mapping.findForward("list"); } else if( request.getParameter("button1") != null ) { return mapping.findForward("form2"); } else { return mapping.findForward("form1"); } } validate実行後にどんなメソッドを呼び出しているのか 分かっていないので、何が原因なのか分かりません。 どんな原因が考えられるのでしょうか? 教えてください。 | ||||||||||||
|
投稿日時: 2004-11-10 21:11
特に必要が無ければ cancel の property を指定するべきではないのでは?
http://struts.apache.org/userGuide/struts-html.html#cancel には以下のように書かれています。
素直に
と記述して Action 側では
で判別してはどうですか? | ||||||||||||
|
投稿日時: 2004-11-11 09:39
ご回答ありがとうございます。
ご指摘のとおりに修正したところ正しく動作しました。 struts歴がまだ10日で、分からないことばかりなので、助かりました。 ありがとうございました。 |
1