public class

MockRequestDispatcher

extends Object
implements RequestDispatcher
java.lang.Object
   ↳ org.springframework.mock.web.MockRequestDispatcher

Class Overview

Mock implementation of the javax.servlet.RequestDispatcher interface.

Used for testing the web framework; typically not necessary for testing application controllers.

Summary

Public Constructors
MockRequestDispatcher(String url)
Create a new MockRequestDispatcher for the given URL.
Public Methods
void forward(ServletRequest request, ServletResponse response)
void include(ServletRequest request, ServletResponse response)
Protected Methods
MockHttpServletResponse getMockHttpServletResponse(ServletResponse response)
Obtain the underlying MockHttpServletResponse, unwrapping HttpServletResponseWrapper decorators if necessary.
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.servlet.RequestDispatcher

Public Constructors

public MockRequestDispatcher (String url)

Create a new MockRequestDispatcher for the given URL.

Parameters
url the URL to dispatch to.

Public Methods

public void forward (ServletRequest request, ServletResponse response)

public void include (ServletRequest request, ServletResponse response)

Protected Methods

protected MockHttpServletResponse getMockHttpServletResponse (ServletResponse response)

Obtain the underlying MockHttpServletResponse, unwrapping HttpServletResponseWrapper decorators if necessary.