Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » web » servlet » mvc » [javadoc | source]
org.springframework.web.servlet.mvc
public class: WebContentInterceptor [javadoc | source]
java.lang.Object
   org.springframework.context.support.ApplicationObjectSupport
      org.springframework.web.context.support.WebApplicationObjectSupport
         org.springframework.web.servlet.support.WebContentGenerator
            org.springframework.web.servlet.mvc.WebContentInterceptor

All Implemented Interfaces:
    HandlerInterceptor, ServletContextAware, ApplicationContextAware

Interceptor that checks and prepares request and response. Checks for supported methods and a required session, and applies the specified number of cache seconds. See superclass bean properties for configuration options.

All the settings supported by this interceptor can also be set on AbstractController. This interceptor is mainly intended for applying checks and preparations to a set of controllers mapped by a HandlerMapping.

Fields inherited from org.springframework.web.servlet.support.WebContentGenerator:
METHOD_GET,  METHOD_HEAD,  METHOD_POST
Fields inherited from org.springframework.context.support.ApplicationObjectSupport:
logger
Method from org.springframework.web.servlet.mvc.WebContentInterceptor Summary:
afterCompletion,   lookupCacheSeconds,   postHandle,   preHandle,   setAlwaysUseFullPath,   setCacheMappings,   setPathMatcher,   setUrlDecode,   setUrlPathHelper
Methods from org.springframework.web.servlet.support.WebContentGenerator:
applyCacheSeconds,   applyCacheSeconds,   cacheForSeconds,   cacheForSeconds,   checkAndPrepare,   checkAndPrepare,   getCacheSeconds,   getSupportedMethods,   isRequireSession,   isUseCacheControlHeader,   isUseCacheControlNoStore,   isUseExpiresHeader,   preventCaching,   setCacheSeconds,   setRequireSession,   setSupportedMethods,   setUseCacheControlHeader,   setUseCacheControlNoStore,   setUseExpiresHeader
Methods from org.springframework.web.context.support.WebApplicationObjectSupport:
getServletContext,   getTempDir,   getWebApplicationContext,   initApplicationContext,   initServletContext,   isContextRequired,   setServletContext
Methods from org.springframework.context.support.ApplicationObjectSupport:
getApplicationContext,   getMessageSourceAccessor,   initApplicationContext,   initApplicationContext,   isContextRequired,   requiredContextClass,   setApplicationContext
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.web.servlet.mvc.WebContentInterceptor Detail:
 public  void afterCompletion(HttpServletRequest request,
    HttpServletResponse response,
    Object handler,
    Exception ex) throws Exception 
    This implementation is empty.
 protected Integer lookupCacheSeconds(String urlPath) 
    Look up a cache seconds value for the given URL path.

    Supports direct matches, e.g. a registered "/test" matches "/test", and various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher class.

 public  void postHandle(HttpServletRequest request,
    HttpServletResponse response,
    Object handler,
    ModelAndView modelAndView) throws Exception 
    This implementation is empty.
 public boolean preHandle(HttpServletRequest request,
    HttpServletResponse response,
    Object handler) throws ServletException 
 public  void setAlwaysUseFullPath(boolean alwaysUseFullPath) 
    Set if URL lookup should always use full path within current servlet context. Else, the path within the current servlet mapping is used if applicable (i.e. in the case of a ".../*" servlet mapping in web.xml). Default is "false".

    Only relevant for the "cacheMappings" setting.

 public  void setCacheMappings(Properties cacheMappings) 
    Map specific URL paths to specific cache seconds.

    Overrides the default cache seconds setting of this interceptor. Can specify "-1" to exclude a URL path from default caching.

    Supports direct matches, e.g. a registered "/test" matches "/test", and a various Ant-style pattern matches, e.g. a registered "/t*" matches both "/test" and "/team". For details, see the AntPathMatcher javadoc.

 public  void setPathMatcher(PathMatcher pathMatcher) 
    Set the PathMatcher implementation to use for matching URL paths against registered URL patterns, for determining cache mappings. Default is AntPathMatcher.
 public  void setUrlDecode(boolean urlDecode) 
    Set if context path and request URI should be URL-decoded. Both are returned undecoded by the Servlet API, in contrast to the servlet path.

    Uses either the request encoding or the default encoding according to the Servlet spec (ISO-8859-1).

    Only relevant for the "cacheMappings" setting.

 public  void setUrlPathHelper(UrlPathHelper urlPathHelper) 
    Set the UrlPathHelper to use for resolution of lookup paths.

    Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and MethodNameResolvers.

    Only relevant for the "cacheMappings" setting.