- - PR -
[Struts] Actionから SwitchActionに対する遷移
1
投稿者 | 投稿内容 | ||||||||
---|---|---|---|---|---|---|---|---|---|
|
投稿日時: 2004-09-24 11:04
お世話になります.
あるActionから、SwitchActionに遷移して、 SubApplicationを切り替えたいのですが、どのように行えばよいのでしょうか? 下記の様に行ってみましたが、駄目でした. 「Switch requires both 'prefix' and 'page' request parameters」と出ます. ====struts-config.xml==== : <form-bean name="hoge_Form" type="org.apache.struts.action.DynaActionForm"> <form-property name="prefix" type="java.lang.String"/> <form-property name="page" type="java.lang.String"/> </form-bean> : <forward name="switch" path="/hoge_switch.do"/> : <action path="/hoge_switch" name="hoge_Form" type="org.apache.struts.actions.SwitchAction"/> : ====hoge_Action.Java==== request.setAttribute( "prefix", "/hogehoge" ); request.setAttribute( "page", "/hogehoge.jsp" ); return mapping.findForward( "switch" ); | ||||||||
|
投稿日時: 2004-09-24 21:42
/hoge_switch.do?prefix="/hogehoge&page=/hogehoge.jsp
で期待通りの動作をしてますか?
requestじゃなくてresponseでは? | ||||||||
|
投稿日時: 2004-09-29 17:22
/hoge_switch.do?prefix="/hogehoge&page=/hogehoge.jsp は期待通りに動作します. responseにsetAttributeは存在しないのですが... | ||||||||
|
投稿日時: 2004-09-30 22:10
ごめんなさい。
では、hoge_Action.Javaでもhoge_Formを使うようにして、そのフォームにsetするようにしてはどうですか。 |
1