Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > Result Types > Redirect Result
Added by casey, last edited by Ted Husted on Dec 07, 2007  (view change)

Calls the {@link HttpServletResponse#sendRedirect(String) sendRedirect} method to the location specified. The response is told to redirect the browser to the specified location (a new request from the client). The consequence of doing this means that the action (action instance, action errors, field errors, etc) that was just executed is lost and no longer available. This is because actions are built on a single-thread model. The only way to pass data is through the session or with web parameters (url?name=value) which can be OGNL expressions.


  • location (default) - the location to go to after execution.
  • parse - true by default. If set to false, the location param will not be parsed for Ognl expressions.

This result follows the same rules from StrutsResultSupport.


<result name="success" type="redirect">
  <param name="location">foo.jsp</param>
  <param name="parse">false</param>
<package name="passingRequestParameters" extends="struts-default" namespace="/passingRequestParameters">
   <-- Pass parameters (reportType, width and height) -->
   The redirect-action url generated will be :
   <action name="gatherReportInfo" class="...">
      <result name="showReportResult" type="redirect">
         <param name="location">generateReport.jsp</param>
         <param name="namespace">/genReport</param>
         <param name="reportType">pie</param>
         <param name="width">100</param>
         <param name="height">100</param>