public class RequestDispatcherImpl extends java.lang.Object implements RequestDispatcher
ERROR_EXCEPTION, ERROR_EXCEPTION_TYPE, ERROR_MESSAGE, ERROR_REQUEST_URI, ERROR_SERVLET_NAME, ERROR_STATUS_CODE, FORWARD_CONTEXT_PATH, FORWARD_PATH_INFO, FORWARD_QUERY_STRING, FORWARD_REQUEST_URI, FORWARD_SERVLET_PATH, INCLUDE_CONTEXT_PATH, INCLUDE_PATH_INFO, INCLUDE_QUERY_STRING, INCLUDE_REQUEST_URI, INCLUDE_SERVLET_PATH
Modifier and Type | Method and Description |
---|---|
void |
dispatch(ServletRequest request,
ServletResponse response) |
void |
dispatchResume(HttpServletRequest request,
HttpServletResponse response,
Invocation invocation)
Dispatch the async resume request to the servlet
named by the request dispatcher.
|
void |
dispatchResume(ServletRequest request,
ServletResponse response) |
void |
error(ServletRequest request,
ServletResponse response) |
void |
forward(ServletRequest request,
ServletResponse response)
Forwards the request to another page.
|
void |
forward(ServletRequest topRequest,
ServletResponse topResponse,
java.lang.String method,
Invocation invocation,
DispatcherType type)
Forwards the request to the servlet named by the request dispatcher.
|
Invocation |
getAsyncInvocation() |
void |
include(ServletRequest request,
ServletResponse response)
Includes the result of another page.
|
void |
include(ServletRequest topRequest,
ServletResponse topResponse,
java.lang.String method)
Include a request into the current page.
|
boolean |
isModified() |
void |
setLogin(boolean isLogin) |
java.lang.String |
toString() |
public void setLogin(boolean isLogin)
public boolean isModified()
public Invocation getAsyncInvocation()
public void forward(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
RequestDispatcher
response.reset()
method to clear
the output buffer.
Query parameters are added to the original query parameters.
The new URI values are based on the RequestDispatcher URI. So getRequestURI(), getServletPath(), and getPathInfo() will reflect the request dispatcher URI.
forward
in interface RequestDispatcher
request
- the original requestresponse
- the original responseServletException
java.io.IOException
public void dispatchResume(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
ServletException
java.io.IOException
public void error(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
ServletException
java.io.IOException
public void dispatch(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
ServletException
java.io.IOException
public void forward(ServletRequest topRequest, ServletResponse topResponse, java.lang.String method, Invocation invocation, DispatcherType type) throws ServletException, java.io.IOException
topRequest
- the servlet request.topResponse
- the servlet response.method
- special to tell if from error.ServletException
java.io.IOException
public void include(ServletRequest request, ServletResponse response) throws ServletException, java.io.IOException
RequestDispatcher
Query parameters are added to the original query parameters.
The included request's URI methods reflect the original URI data. So getRequestURI() will return the URI sent by the browser.
Included pages should use request.getAttribute() to get the new URI values:
getRequestURI | javax.servlet.include.request_uri |
getContextPath | javax.servlet.include.context_path |
getServletPath | javax.servlet.include.servlet_path |
getPathInfo | javax.servlet.include.path_info |
getQueryString | javax.servlet.include.query_string |
include
in interface RequestDispatcher
request
- the original requestresponse
- the original responseServletException
java.io.IOException
public void include(ServletRequest topRequest, ServletResponse topResponse, java.lang.String method) throws ServletException, java.io.IOException
ServletException
java.io.IOException
public void dispatchResume(HttpServletRequest request, HttpServletResponse response, Invocation invocation) throws ServletException, java.io.IOException
request
- the servlet request.response
- the servlet response.invocation
- current invocationServletException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object