File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 validation chaining

 
anand kumarblr
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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
record.

My struts.xml looks something like this ->

<action name="add" class="com.test.AddAction">
<result name="success" type="chain">
list
</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 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
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too have the same issue. i am looking for a answer

I hope that we have done mistake in interceptors

http://www.coderanch.com/t/475156/Struts/Applicati...works/Struts-Chain-Result-Type
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic