Ok here is the code:
<action-mappings>
<action path="/MyAction" type="com.MyAction" validate="false">
<forward name="success1" path="/MyAction.do"></forward>
<forward name="failure" path="/jsp/error.jsp"></forward>
<forward name="success2" path="/MyAction.do"></forward>
<forward name="success3" path="/SomeAction.do"></forward>
</action>
<action path="/SomeAction" type="com.SomeAction" validate="false">
<forward name="failure" path="/jsp/error.jsp"></forward>
</action>
</action-mappings>
public class MyAction extends Action {
public ActionForward perform(ActionMapping mapping,ActionForm form,
HttpServletRequest request,
HttpServletResponse response)throws IOException, ServletException {
boolean condition1=true,condition2=true,condition3=true;
try {
if(condition1){
System.out.println("condition1 is:"+condition1);
mapping.findForward("success1");
}
if(condition2){
System.out.println("condition2 is:"+condition2);
mapping.findForward("success2");
}
if(condition3){
System.out.println("condition3 is:"+condition3);
mapping.findForward("success3");
}
}catch (Exception ex) {
return mapping.findForward("failure");
}
}
}
