Save This Page
Home » struts-2.1.8.1-src » org.apache » struts2 » dispatcher » [javadoc | source]
org.apache.struts2.dispatcher
public class: ServletDispatcherResult [javadoc | source]
java.lang.Object
   org.apache.struts2.dispatcher.StrutsResultSupport
      org.apache.struts2.dispatcher.ServletDispatcherResult

All Implemented Interfaces:
    com.opensymphony.xwork2.Result, StrutsStatics

Direct Known Subclasses:
    TilesResult

Includes or forwards to a view (usually a jsp). Behind the scenes Struts will use a RequestDispatcher, where the target servlet/JSP receives the same request/response objects as the original servlet/JSP. Therefore, you can pass data between them using request.setAttribute() - the Struts action is available.

There are three possible ways the result can be executed:

This result type takes the following parameters: Example:

<result name="success" type="dispatcher">
  <param name="location">foo.jsp</param>
</result>
This result follows the same rules from StrutsResultSupport .
Fields inherited from org.apache.struts2.dispatcher.StrutsResultSupport:
DEFAULT_PARAM
Constructor:
 public ServletDispatcherResult() 
 public ServletDispatcherResult(String location) 
Method from org.apache.struts2.dispatcher.ServletDispatcherResult Summary:
doExecute
Methods from org.apache.struts2.dispatcher.StrutsResultSupport:
conditionalParse,   doExecute,   execute,   getLastFinalLocation,   getLocation,   setEncode,   setLocation,   setParse
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.dispatcher.ServletDispatcherResult Detail:
 public  void doExecute(String finalLocation,
    ActionInvocation invocation) throws Exception 
    Dispatches to the given location. Does its forward via a RequestDispatcher. If the dispatch fails a 404 error will be sent back in the http response.