Generated by
JDiff

org.springframework.mock.web Documentation Differences

This file contains all the changes in documentation in the package org.springframework.mock.web as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class MockFilterChain

Mock implementation of the javax.servlet.FilterConfigFilterChain interface.

Used for testing the web framework; also useful for testing custom javax.servlet.Filter implementations. @author Juergen Hoeller @author Rob Winch @since 2.0.3 @see MockFilterConfig @see PassThroughFilterChain

Class MockFilterChain, void doFilter(ServletRequest, ServletResponse)

Records theInvoke registered Filters and/or Servlet also saving the request and response.

Class MockHttpServletResponse, String encodeRedirectURL(String)

The default implementation delegates to .encodeURL, returning the given URL String as-is.

Can be overridden in subclasses, appending a session id or the like in a redirect-specific fashion. For general URL encoding rules, override the common .encodeURL method instead, appyling applying to redirect URLs as well as to general URLs.

Class MockHttpServletResponse, String getHeader(String)

Return the primary value for the given header as a String, if any. Will return the first value in case of multiple values.

As of Servlet 3.0, this method is also defined in HttpServletResponse. As of Spring 3.1, it returns a stringified value for Servlet 3.0 compatibility. Consider using .getHeaderValue(String) for raw Object access. @param name the name of the header @return the associated header value, or null if none

Class MockHttpServletResponse, List<String> getHeaders(String)

Return all values for the given header as a List of Strings.

As of Servlet 3.0, this method is also defined in HttpServletResponse. As of Spring 3.1, it returns a List of stringified values for Servlet 3.0 compatibility. Consider using .getHeaderValues(String) for raw Object access. @param name the name of the header @return the associated header values, or an empty List if none


Class MockHttpSession

Mock implementation of the javax.servlet.http.HttpSession interface.

Compatible with Servlet 2.5 as well as Servlet 3.0.

Used for testing the web framework; also useful for testing application controllers. @author Juergen Hoeller @author Rod Johnson @author Mark Fisher @author Sam Brannen @since 1.0.2


Class MockRequestDispatcher

Mock implementation of the javax.servlet.RequestDispatcher interface.

Used for testing the web framework; typically not necessary for testing application controllers. @author Rod Johnson @author Juergen Hoeller @author Sam Brannen @since 1.0.2

Class MockRequestDispatcher, constructor MockRequestDispatcher(String)

Create a new MockRequestDispatcher for the given URLresource. @param urlresource the URLserver resource to dispatch to., located at a particular path or given by a particular name
Class MockRequestDispatcher, MockHttpServletResponse getMockHttpServletResponse(ServletResponse)

Obtain the underlying MockHttpServletResponse, unwrappingunwrapping HttpServletResponseWrapper decorators if necessary.

Class MockServletContext

Mock implementation of the javax.servlet.ServletContext interface.

Compatible with Servlet 2.5 and partially with Servlet 3.0. Can be configured to expose a specific version through .setMajorVersion/.setMinorVersion; default is 2.5. Note that Servlet 3.0 support is limited: servlet, filter and listener registration methods are not supported; neither is cookie or JSP configuration. We generally do not recommend to unit-test your ServletContainerInitializers and WebApplicationInitializers which is where those registration methods would be used.

Used for testing the Spring web framework; only rarely necessary for testing application controllers. As long as application components don't explicitly access the {@code ServletContext}, {@code ClassPathXmlApplicationContext} or {@code FileSystemXmlApplicationContext} can be used to load the context filesfiles for testing, even for {@code DispatcherServlet} context definitions.

For setting up a full {@code WebApplicationContext} in a test environment, you can can use {@code AnnotationConfigWebApplicationContext}, {@code XmlWebApplicationContext}, (or {@code GenericWebApplicationContext)}, passing in an an appropriate {@code MockServletContext} instance. You might wantwant to configure your your {@code MockServletContext} with a {@code FileSystemResourceLoader} in that case, to make your ensure that resource paths are interpreted as relative filefilesystem system locations.

A common setup is to point your JVM working directory to the root of your web application directory, in combination with filesystem-based resource loading. This allows to load the context files as used in the web application, with relative paths getting interpreted correctly. Such a setup will work with both {@code FileSystemXmlApplicationContext} (which will load straight from the filethe systemfilesystem) and {@code XmlWebApplicationContext} with an underlyingunderlying {@code MockServletContext} (as long as as the {@code MockServletContext} has beenbeen configured with a {@code FileSystemResourceLoader}). @author Rod Johnson @author Juergen Hoeller @author Sam Brannen @since 1.0.2 @see #MockServletContext(org.springframework.core.io.ResourceLoader) @see org.springframework.web.context.support.AnnotationConfigWebApplicationContext @see org.springframework.web.context.support.XmlWebApplicationContext @see org.springframework.web.context.support.GenericWebApplicationContext @see org.springframework.context.support.ClassPathXmlApplicationContext @see org.springframework.context.support.FileSystemXmlApplicationContext

Class MockServletContext, constructor MockServletContext(String)

Create a new MockServletContext, using a DefaultResourceLoader. @param resourceBasePath the WAR root directory of the WAR (should not end with a slash) @see org.springframework.core.io.DefaultResourceLoader
Class MockServletContext, constructor MockServletContext(String, ResourceLoader)

Create a new MockServletContext using the supplied resource base path and resource loader.

Registers a MockRequestDispatcher for the Servlet named {@value #COMMON_DEFAULT_SERVLET_NAME}. @param resourceBasePath the WAR root directory of the WAR (should not end with a slash) @param resourceLoader the ResourceLoader to use (or null for the default) @see #registerNamedDispatcher