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 FormDEFAULT_PARAM, DEFAULT_URL_ENCODING, parseLocation
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 |
setUrlHelper(UrlHelper urlHelper) |
conditionalParse, conditionalParseCollection, execute, getLastFinalLocation, getLocation, setEncode, setLocation, setParse
public ServletDispatcherResult()
public ServletDispatcherResult(String location)
public void setUrlHelper(UrlHelper urlHelper)
public void doExecute(String finalLocation, ActionInvocation invocation) throws Exception
doExecute
in class StrutsResultSupport
finalLocation
- 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–2020 Apache Software Foundation. All rights reserved.