How to configure struts.xml with validate?
Hello guys!I'm working with a struts 2 application.
In struts.xml I got:
[code]
<action name="productview" class="se.asite.site.action.ProductViewAction" method="execute">
<result name="success" type="tiles">product</result>
<result name="error" type="tiles">error</result>
</action>
<action name="ordersave" class="se.asite.site.action.OrderAction" method="save">
<result name="input" >product</result>
<result name="success" type="tiles">orderThankYou</result>
<result name="error" type="tiles">error</result>
</action>
[/code]
In tiles.xml I got:
[code]
<definition name="products" extends="baseLayout">
<put-attribute name="title" value="www.asite.se - Products" />
<put-attribute name="body" value="/products.jsp" />
</definition>
[/code]
The user enters product.jsp through ProductViewAction and submits a form to "ordersave".
But if validate() in OrderAction fails the user is redirected back to "product" direct to product.jsp without passing ProductViewAction.
So my problem is how to get back to product.jsp via ProductViewAction?
I have tried to set:
[code]
<result name="input" >productview</result>
[/code]
...but that does not work at all.
Best regards
Fredrik