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:
include method is called.forward
 is made.include
 is called.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, 
Serialized FormResult.LegacyAdapterDEFAULT_PARAM, DEFAULT_URL_ENCODING, parseLocationACTION_MAPPING, HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT| Constructor and Description | 
|---|
| ServletDispatcherResult() | 
| ServletDispatcherResult(String location) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | doExecute(String finalLocation,
         ActionInvocation invocation)Dispatches to the given location. | 
| protected HttpParameters | getParameters(ActionInvocation invocation) | 
| void | setQueryStringParser(QueryStringParser queryStringParser) | 
conditionalParse, conditionalParseCollection, doExecute, execute, getLastFinalLocation, getLocation, setEncode, setLocation, setParsepublic ServletDispatcherResult()
public ServletDispatcherResult(String location)
public void setQueryStringParser(QueryStringParser queryStringParser)
public void doExecute(String finalLocation, ActionInvocation invocation) throws Exception
doExecute in class StrutsResultSupportfinalLocation - the location to dispatch to.invocation - the execution state of the actionException - if an error occurs. If the dispatch fails the error will go back via the
                   HTTP request.protected HttpParameters getParameters(ActionInvocation invocation)
Copyright © 2000–2025 Apache Software Foundation. All rights reserved.