public final class ApplicationDispatcher extends Object implements javax.servlet.RequestDispatcher
RequestDispatcher
that allows a
request to be forwarded to a different resource to create the ultimate
response, or to include the output of another resource in the response
from this resource. This implementation allows application level servlets
to wrap the request and/or response objects that are passed on to the
called resource, as long as the wrapping classes extend
javax.servlet.ServletRequestWrapper
and
javax.servlet.ServletResponseWrapper
.Modifier and Type | Class and Description |
---|---|
protected class |
ApplicationDispatcher.PrivilegedAsync |
protected class |
ApplicationDispatcher.PrivilegedForward |
protected class |
ApplicationDispatcher.PrivilegedInclude |
protected class |
ApplicationDispatcher.PrivilegedInvoke |
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
Constructor and Description |
---|
ApplicationDispatcher(Wrapper wrapper,
String requestURI,
String requestPath,
String servletPath,
String pathInfo,
String queryString,
String name)
Construct a new instance of this class, configured according to the
specified parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
async(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
boolean attributes)
Async forward this request and response to another resource for processing.
|
void |
forward(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Forward this request and response to another resource for processing.
|
String |
getInfo()
Return the descriptive information about this implementation.
|
void |
include(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Include the response from another resource in the current response.
|
void |
invoke(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Batch forward this request and response to another resource for processing.
|
public ApplicationDispatcher(Wrapper wrapper, String requestURI, String requestPath, String servletPath, String pathInfo, String queryString, String name)
null
, it will be assumed that this RequestDispatcher
was acquired by name, rather than by path.wrapper
- The Wrapper associated with the resource that will
be forwarded to or included (required)requestURI
- The request URI to this resource (if any)requestPath
- The revised path to this resource, relative to the context (if any)servletPath
- The revised servlet path to this resource (if any)pathInfo
- The revised extra path information to this resource
(if any)queryString
- Query string parameters included with this request
(if any)name
- Servlet name (if a named dispatcher was created)
else null
public String getInfo()
public void invoke(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, IOException
request
- The servlet request to be forwardedresponse
- The servlet response to be forwardedIOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet exception occurspublic void async(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, boolean attributes) throws javax.servlet.ServletException, IOException
request
- The servlet request to be forwardedresponse
- The servlet response to be forwardedIOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet exception occurspublic void forward(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, IOException
forward
in interface javax.servlet.RequestDispatcher
request
- The servlet request to be forwardedresponse
- The servlet response to be forwardedIOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet exception occurspublic void include(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, IOException
include
in interface javax.servlet.RequestDispatcher
request
- The servlet request that is including this oneresponse
- The servlet response to be appended toIOException
- if an input/output error occursjavax.servlet.ServletException
- if a servlet exception occursCopyright © 2014 JBoss by Red Hat. All Rights Reserved.