- All Implemented Interfaces:
- 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
There are three possible ways the result can be executed:
This result type takes the following parameters:
- If we are in the scope of a JSP (a PageContext is available), PageContext's
include method is called.
- If there is no PageContext and we're not in any sort of include (there is no
"javax.servlet.include.servlet_path" in the request attributes), then a call to
- location (default) - the location to go to after execution (ex. jsp).
- parse - true by default. If set to false, the location param will not be parsed for Ognl expressions.
<result name="success" type="dispatcher">
This result follows the same rules from
- See Also:
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ServletDispatcherResult(String location)
public void setUrlHelper(UrlHelper urlHelper)
public void doExecute(String finalLocation,
- 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.
- Specified by:
doExecute in class
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
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.