Good afternoon in my timezone.
I am developing a web application using struts framework. In a simple way, when the user call the application the first Action to be call is the SecurityAction, then this action redirects to one of the two actions, this is how i make the redirect :
if (user == "type_profile")
forward = mapping.forward("action2Fwd");
else
forward = mapping.forward("action3Fwd");
return forward;
In the struts-config.xml i have
<global-forwards>
<forward name="action2Fwd" path="/action2.do"/>
<forward name="action3Fwd" path="/action3.do"/>
</global-forwards>
<action path="/action2"
type="com.teste.dummy.action2"
name="actionForm"
validate="true"
input="/action2.jsp">
</action>
My first question: Is this the best way to redirect from an action to another action ?
Second question : When i redirect to another action, the actionForm will execute, how can i know that this request come from another action ?
Inside the form if the request comes from another action i do not want to validate anything , so i have to know that this request comes from another action and not from the "browser", one solution is to put some kind of flag in the request or session scope indicating that this request comes from another action, but is this the best way ?