wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts 2 validation chaining Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 validation chaining" Watch "Struts 2 validation chaining" New topic

Struts 2 validation chaining

anand kumarblr

Joined: Oct 27, 2006
Posts: 27
I am trying to use actionchaining 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

My struts.xml looks something like this ->

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

I have 1 issues/questions -
a) My validation does not work if I chainactions. 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.

I would really appreciate some feedback/help here.
Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70
I too have the same issue. i am looking for a answer

I hope that we have done mistake in interceptors

It is sorta covered in the JavaRanch Style Guide.
subject: Struts 2 validation chaining
Similar Threads
Pass bean from one action to another in strust2
struts 2 and messages !!
No Result defined for action in struts2.samples.actions.ReportsAction and result success
Interceptor messes up action class in Struts2
can any one explain how the data is comming in Action directly pls