Top Fields Constructors Methods
io.undertow.servlet.spec

public Class RequestDispatcherImpl

extends Object
implements RequestDispatcher
Class Inheritance
All Implemented Interfaces
jakarta.servlet.RequestDispatcher
Imports
java.io.IOException, .PrintWriter, java.security.AccessController, .PrivilegedActionException, .PrivilegedExceptionAction, java.util.Deque, .Map, jakarta.servlet.DispatcherType, .RequestDispatcher, .ServletException, .ServletOutputStream, .ServletRequest, .ServletRequestWrapper, .ServletResponse, .ServletResponseWrapper, jakarta.servlet.http.HttpServletRequest, .HttpServletResponse, io.undertow.UndertowLogger, io.undertow.server.HttpServerExchange, io.undertow.servlet.UndertowServletLogger, .UndertowServletMessages, io.undertow.servlet.api.ThreadSetupHandler, io.undertow.servlet.handlers.ServletRequestContext, .ServletChain, .ServletPathMatch, io.undertow.servlet.util.DispatchUtils, io.undertow.util.ParameterLimitException

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private final ServletChain
private final boolean
private final String
private final ServletContextImpl

Constructor Summary

AccessConstructor and Description
public
RequestDispatcherImpl(final String path, final ServletContextImpl servletContext)

public
RequestDispatcherImpl(final ServletChain chain, final ServletContextImpl servletContext)

Method Summary

Modifier and TypeMethod and Description
public void
error(ServletRequestContext servletRequestContext, final ServletRequest request, final ServletResponse response, final String servletName, final String message)

public void
error(ServletRequestContext servletRequestContext, final ServletRequest request, final ServletResponse response, final String servletName)

public void
error(ServletRequestContext servletRequestContext, final ServletRequest request, final ServletResponse response, final String servletName, final Throwable exception)

private void
error(ServletRequestContext servletRequestContext, final ServletRequest request, final ServletResponse response, final String servletName, final Throwable exception, final String message)

public void
forward(final ServletRequest
a ServletRequest object that represents the request the client makes of the servlet
request
,
final ServletResponse
a ServletResponse object that represents the response the servlet returns to the client
response
)

Implements jakarta.servlet.RequestDispatcher.forward.

Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server.

private void
forwardImpl(ServletRequest request, ServletResponse response, ServletRequestContext servletRequestContext)

private void
forwardImplSetup(final ServletRequest request, final ServletResponse response)

public void
include(final ServletRequest
a ServletRequest object that contains the client's request
request
,
final ServletResponse
a ServletResponse object that contains the servlet's response
response
)

Implements jakarta.servlet.RequestDispatcher.include.

Includes the content of a resource (servlet, JSP page, HTML file) in the response.

private void
includeImpl(ServletRequest request, ServletResponse response, ServletRequestContext servletRequestContext, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl)

public void
mock(ServletRequest request, ServletResponse response)

private void
setupIncludeImpl(final ServletRequest request, final ServletResponse response)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chainback to summary
private final ServletChain chain
namedback to summary
private final boolean named
pathback to summary
private final String path
servletContextback to summary
private final ServletContextImpl servletContext

Constructor Detail

RequestDispatcherImplback to summary
public RequestDispatcherImpl(final String path, final ServletContextImpl servletContext)
RequestDispatcherImplback to summary
public RequestDispatcherImpl(final ServletChain chain, final ServletContextImpl servletContext)

Method Detail

errorback to summary
public void error(ServletRequestContext servletRequestContext, final ServletRequest request, final ServletResponse response, final String servletName, final String message) throws ServletException, IOException
errorback to summary
public void error(ServletRequestContext servletRequestContext, final ServletRequest request, final ServletResponse response, final String servletName) throws ServletException, IOException
errorback to summary
public void error(ServletRequestContext servletRequestContext, final ServletRequest request, final ServletResponse response, final String servletName, final Throwable exception) throws ServletException, IOException
errorback to summary
private void error(ServletRequestContext servletRequestContext, final ServletRequest request, final ServletResponse response, final String servletName, final Throwable exception, final String message) throws ServletException, IOException
forwardback to summary
public void forward(final ServletRequest request, final ServletResponse response) throws ServletException, IOException

Implements jakarta.servlet.RequestDispatcher.forward.

Doc from jakarta.servlet.RequestDispatcher.forward.

Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. This method allows one servlet to do preliminary processing of a request and another resource to generate the response.

For a RequestDispatcher obtained via getRequestDispatcher(), the ServletRequest object has its path elements and parameters adjusted to match the path of the target resource.

forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.

The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the ServletRequestWrapper or ServletResponseWrapper classes that wrap them.

This method sets the dispatcher type of the given request to DispatcherType.FORWARD.

Parameters
request:ServletRequest

a ServletRequest object that represents the request the client makes of the servlet

response:ServletResponse

a ServletResponse object that represents the response the servlet returns to the client

Annotations
@Override
Exceptions
ServletException:
if the target resource throws this exception
IOException:
if the target resource throws this exception
forwardImplback to summary
private void forwardImpl(ServletRequest request, ServletResponse response, ServletRequestContext servletRequestContext) throws ServletException, IOException
forwardImplSetupback to summary
private void forwardImplSetup(final ServletRequest request, final ServletResponse response) throws ServletException, IOException
includeback to summary
public void include(final ServletRequest request, final ServletResponse response) throws ServletException, IOException

Implements jakarta.servlet.RequestDispatcher.include.

Doc from jakarta.servlet.RequestDispatcher.include.

Includes the content of a resource (servlet, JSP page, HTML file) in the response. In essence, this method enables programmatic server-side includes.

The ServletResponse object has its path elements and parameters remain unchanged from the caller's. The included servlet cannot change the response status code or set headers; any attempt to make a change is ignored.

The request and response parameters must be either the same objects as were passed to the calling servlet's service method or be subclasses of the ServletRequestWrapper or ServletResponseWrapper classes that wrap them.

This method sets the dispatcher type of the given request to DispatcherType.INCLUDE.

Parameters
request:ServletRequest

a ServletRequest object that contains the client's request

response:ServletResponse

a ServletResponse object that contains the servlet's response

Annotations
@Override
Exceptions
ServletException:
if the included resource throws this exception
IOException:
if the included resource throws this exception
includeImplback to summary
private void includeImpl(ServletRequest request, ServletResponse response, ServletRequestContext servletRequestContext, HttpServletRequestImpl requestImpl, HttpServletResponseImpl responseImpl) throws ServletException, IOException
mockback to summary
public void mock(ServletRequest request, ServletResponse response) throws ServletException, IOException
setupIncludeImplback to summary
private void setupIncludeImpl(final ServletRequest request, final ServletResponse response) throws ServletException, IOException