org.springframework.mock.web
Class MockRequestDispatcher
java.lang.Object
org.springframework.mock.web.MockRequestDispatcher
public class MockRequestDispatcher
- extends java.lang.Object
Mock implementation of the javax.servlet.RequestDispatcher
interface.
Used for testing the web framework; typically not necessary for
testing application controllers.
- Since:
- 1.0.2
- Author:
- Rod Johnson, Juergen Hoeller
Field Summary |
private Log |
logger
|
private java.lang.String |
url
|
Constructor Summary |
MockRequestDispatcher(java.lang.String url)
Create a new MockRequestDispatcher for the given URL. |
Method Summary |
void |
forward(ServletRequest request,
ServletResponse response)
|
protected MockHttpServletResponse |
getMockHttpServletResponse(ServletResponse response)
Obtain the underlying MockHttpServletResponse,
unwrapping HttpServletResponseWrapper decorators if necessary. |
void |
include(ServletRequest request,
ServletResponse response)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private final Log logger
url
private final java.lang.String url
MockRequestDispatcher
public MockRequestDispatcher(java.lang.String url)
- Create a new MockRequestDispatcher for the given URL.
- Parameters:
url
- the URL to dispatch to.
forward
public void forward(ServletRequest request,
ServletResponse response)
include
public void include(ServletRequest request,
ServletResponse response)
getMockHttpServletResponse
protected MockHttpServletResponse getMockHttpServletResponse(ServletResponse response)
- Obtain the underlying MockHttpServletResponse,
unwrapping
HttpServletResponseWrapper
decorators if necessary.