HDIV API 2.0.4

org.hdiv.dispatcher
Class HDIVServletRedirectResult

java.lang.Object
  extended by org.apache.struts2.dispatcher.StrutsResultSupport
      extended by org.apache.struts2.dispatcher.ServletRedirectResult
          extended by org.hdiv.dispatcher.HDIVServletRedirectResult
All Implemented Interfaces:
com.opensymphony.xwork2.Result, java.io.Serializable, org.apache.struts2.StrutsStatics
Direct Known Subclasses:
HDIVServletActionRedirectResult

public class HDIVServletRedirectResult
extends org.apache.struts2.dispatcher.ServletRedirectResult

Calls the 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.

This result type takes the following parameters:

This result follows the same rules from StrutsResultSupport.

Example:
  <!-- START SNIPPET: example -->
   <result name="success" type="redirect">
     <param name="location">foo.jsp</param>
     <param name="parse">false</param>
   </result>
   <!-- END SNIPPET: example -->
 

Since:
HDIV 2.0
Author:
Gorka Vicente
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.struts2.dispatcher.ServletRedirectResult
actionMapper, prependServletContext
 
Fields inherited from class org.apache.struts2.dispatcher.StrutsResultSupport
DEFAULT_PARAM
 
Fields inherited from interface org.apache.struts2.StrutsStatics
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_PORTLET_CONTEXT
 
Constructor Summary
HDIVServletRedirectResult()
           
HDIVServletRedirectResult(java.lang.String location)
           
 
Method Summary
protected  void doExecute(java.lang.String finalLocation, com.opensymphony.xwork2.ActionInvocation invocation)
          Redirects to the location specified by calling HttpServletResponse.sendRedirect(String).
 
Methods inherited from class org.apache.struts2.dispatcher.ServletRedirectResult
setActionMapper, setPrependServletContext
 
Methods inherited from class org.apache.struts2.dispatcher.StrutsResultSupport
conditionalParse, execute, getLastFinalLocation, setEncode, setLocation, setParse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HDIVServletRedirectResult

public HDIVServletRedirectResult()

HDIVServletRedirectResult

public HDIVServletRedirectResult(java.lang.String location)
Method Detail

doExecute

protected void doExecute(java.lang.String finalLocation,
                         com.opensymphony.xwork2.ActionInvocation invocation)
                  throws java.lang.Exception
Redirects to the location specified by calling HttpServletResponse.sendRedirect(String).

Overrides:
doExecute in class org.apache.struts2.dispatcher.ServletRedirectResult
Parameters:
finalLocation - the location to redirect to.
invocation - an encapsulation of the action execution state.
Throws:
java.lang.Exception - if an error occurs when redirecting.

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.