I am having a slight issue with validation in struts2 during consecutive validations.Now if an error is found on the form for the first time the correct url is used such as:
http://localhost:8080/Appname/Secure/AddAction.action
However if there is an error on the form during second time validation The resulting url is used (This url is wrong)
http://localhost:8080/Appname/AddAction.action
This is what i have in struts.xml
<action name="AddAction" class="controller.AddAction">
<param name="dR"></param>
<param name="dS"></param>
<result name="input">/Secure/AddAction.jsp</result>
<result name="error">/Error.jsp</result>
<result name="success" type="redirect">
<param name="location">/Secure/AddAction.jsp?msg=${msg}</param>
</result>
</action>
Any suggestions on how i cld fix the problem
Edit: Update:
So in the validation i put the following code
HttpServletRequest request = ServletActionContext.getRequest();
String r = request.getRequestURI();
The first time its : /Appname/Secure/AddAction.action
But the next time its : /Appname/AddAction.action
How can i make them same both times ?
which namespace located your action? default or Secure? try this maybe: