原帖由 nicky_39 於 2006-8-24 06:03 AM 發表
What have you got set up in the struts-config.html?
For example, in the within the <action-mappings> scope, if you have set:
<action path="/action1" type="action1Action" name="form1" scope="request" input="form1.jsp">
<forward name="action1" path="form1.jsp"/>
</action>
This would be couple form1 and action1.
Try playing around with the struts-config.html.
Hope this has helped.
<action path="/action1" type="action1Action" name="form1" scope="request" input="form1.jsp">
<forward name="action1" path="form1.jsp"/>
</action>
<action path="/action2" type="action2Action" name="form2" scope="request" input="form2.jsp">
<forward name="action1" path="form2.jsp"/>
</action>
The forwarding itself works ok. It goes to where I want it to. The problem occured when I want to submit form1.jsp to action2, if the form tag points to action2, all the tag library tags must be in form2 bean. But after action1 forwarded to form1.jsp, which contains a form with action2, it complains (see my first post for more details). So form1.jsp must contains form with action1. That means I cannot submit form1.jsp directly to action2, I have to submit it back to action1, and let action1 do the forwarding to action2.
At the end, it works what I wanted it to, but I am just not sure if this is the proper way and the only way to do this.