Hi Everyone,
I am having hard time making Struts2 Validation Framework work in my scenario. Please help me solving the problem.
My Scenario:
1] My ActionClass implement ModelView Interface. It has three methods to add, delete and update. Consider I have three JSPS, add.jsp, update,
jsp, delete.jsp
2] I need validation in update.jsp, add.jsp which has different UI so created a validation file ActionClass-update-validations.xml and ActionClass-add-validations.xml respectively.
3] My struts.xml has one action tag with 3 different result as seen below
<action name="myaction_*" method="{1}" class="MyAction">
<interceptor-ref name="defaultStack"/>
<result name="input">jsps/edit.jsp</result>
<result name="list">jsps/add.jsp</result>
<result name="list">jsps/list.jsp</result>
<result name="edit">jsps/edit.jsp</result>
</action>
For validation i have to supply result="input" jsps which will display error messages. I have validation in 3 jsps. How can I provide 3 different "input" jsps each for add.jsp, edit.jsp etc ? Also how to maintain the request values on JSP if validation fails.
Also How to use annotations in this scenario