org.apache.struts2.dispatcher
类 ServletDispatcherResult

java.lang.Object
  继承者 org.apache.struts2.dispatcher.StrutsResultSupport
      继承者 org.apache.struts2.dispatcher.ServletDispatcherResult
所有已实现的接口:
com.opensymphony.xwork2.Result, Serializable, StrutsStatics

public class ServletDispatcherResult
extends StrutsResultSupport

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.

另请参见:
RequestDispatcher, 序列化表格

字段摘要
 
从类 org.apache.struts2.dispatcher.StrutsResultSupport 继承的字段
DEFAULT_PARAM
 
从接口 org.apache.struts2.StrutsStatics 继承的字段
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT
 
构造方法摘要
ServletDispatcherResult()
           
ServletDispatcherResult(String location)
           
 
方法摘要
 void doExecute(String finalLocation, com.opensymphony.xwork2.ActionInvocation invocation)
          Dispatches to the given location.
 void setUrlHelper(UrlHelper urlHelper)
           
 
从类 org.apache.struts2.dispatcher.StrutsResultSupport 继承的方法
execute, getLastFinalLocation, getLocation, setEncode, setLocation, setParse
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ServletDispatcherResult

public ServletDispatcherResult()

ServletDispatcherResult

public ServletDispatcherResult(String location)
方法详细信息

setUrlHelper

public void setUrlHelper(UrlHelper urlHelper)

doExecute

public void doExecute(String finalLocation,
                      com.opensymphony.xwork2.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.

参数:
finalLocation - the location to dispatch to.
invocation - the execution state of the action
抛出:
Exception - if an error occurs. If the dispatch fails the error will go back via the HTTP request.