Hi
I am trying to use action chaining in struts2 and am stuck. Any help would
be really appreciated.

Scenario - I have a page that shows a list of records and also has a form to
add a new record. When user clicks on add I call addAction and chain it to
list action to go back to list page again showing the newly added record.

My struts.xml looks something like this ->

<action name="add" class="com.test.AddAction">
   <result name="success" type="chain">
   <param name="actionName">list</param>
   </result>
   <result name="input" type="chain">list</result>
</action>
<action name="list" class="com.test.ListAction">
   <result name="success">/proj/list.jsp</result>
</action>

I have 2 issues/questions - 
a) My validation does not work if I chain actions. If I don't enter anything
in add textbox and click on Add then I get a html 404 error. If I route to
list.jsp instead of chaning to list action then I see validation messages.
But I really need to show list on that page as well. So I can not forward to
the jsp.

b) When I chain 2 actions, can I pass new params for second action? It does
not seem to work for me e.g. In following example, I can not pass foo param
to list action that is chained to add action.

<action name="add" class="com.test.AddAction">
<result name="success" type="chain">
<param name="actionName">list</param>
<param name="foo">bar</param>
</result>
<result name="input" type="chain">list</result>
</action>

I would really appreciate some feedback/help here.
-- 
View this message in context: 
http://www.nabble.com/Questions-on-action-chaining-and-validation-in-struts2---please-help-tf3590988.html#a10036082
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to