less than 1 minute read

struts redirect howto different web contexts
webappA sendredirect to webappB
String url = response.encodeRedirectURL("urlwithparameters");
System.out.println("url = " + url);
response.sendRedirect(url);
return null;

webappB receive request process it findforward to redirect jsp
<action path="/url" type="SysAction" name="GenericForm" scope="session">
<forward name="success" path="/redirect.jsp" ></forward>
<forward name="fail" path="/error.jsp"></forward>
</action>

redirect.jsp forwards to global forward jsp
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<logic:redirect forward="/goto-global-forward"/>

global forward struts-config.xml
<global-forwards>
<forward name="/goto-global-forward" path="/theactualpage.jsp" />
</global-forwards>

this forwards to the actual page you want to goto with the parameters

Tags:

Updated:

Comments