Package org.springframework.mock.web
Class MockRequestDispatcher
java.lang.Object
org.springframework.mock.web.MockRequestDispatcher
- All Implemented Interfaces:
RequestDispatcher
Mock implementation of the
RequestDispatcher
interface.- Since:
- 1.0.2
- Author:
- Rod Johnson, Juergen Hoeller, Sam Brannen
- See Also:
-
Field Summary
Fields inherited from interface jakarta.servlet.RequestDispatcher
ERROR_EXCEPTION, ERROR_EXCEPTION_TYPE, ERROR_MESSAGE, ERROR_REQUEST_URI, ERROR_SERVLET_NAME, ERROR_STATUS_CODE, FORWARD_CONTEXT_PATH, FORWARD_MAPPING, FORWARD_PATH_INFO, FORWARD_QUERY_STRING, FORWARD_REQUEST_URI, FORWARD_SERVLET_PATH, INCLUDE_CONTEXT_PATH, INCLUDE_MAPPING, INCLUDE_PATH_INFO, INCLUDE_QUERY_STRING, INCLUDE_REQUEST_URI, INCLUDE_SERVLET_PATH
-
Constructor Summary
ConstructorDescriptionMockRequestDispatcher
(String resource) Create a new MockRequestDispatcher for the given resource. -
Method Summary
Modifier and TypeMethodDescriptionvoid
forward
(ServletRequest request, ServletResponse response) protected MockHttpServletResponse
getMockHttpServletResponse
(ServletResponse response) Obtain the underlyingMockHttpServletResponse
, unwrappingHttpServletResponseWrapper
decorators if necessary.void
include
(ServletRequest request, ServletResponse response)
-
Constructor Details
-
MockRequestDispatcher
Create a new MockRequestDispatcher for the given resource.- Parameters:
resource
- the server resource to dispatch to, located at a particular path or given by a particular name
-
-
Method Details
-
forward
- Specified by:
forward
in interfaceRequestDispatcher
-
include
- Specified by:
include
in interfaceRequestDispatcher
-
getMockHttpServletResponse
Obtain the underlyingMockHttpServletResponse
, unwrappingHttpServletResponseWrapper
decorators if necessary.
-