org.springframework.mock.web
Class MockRequestDispatcher

java.lang.Object
  extended by 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
 

Field Detail

logger

private final Log logger

url

private final java.lang.String url
Constructor Detail

MockRequestDispatcher

public MockRequestDispatcher(java.lang.String url)
Create a new MockRequestDispatcher for the given URL.

Parameters:
url - the URL to dispatch to.
Method Detail

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.