| org.springframework.web.servlet.support.WebContentGenerator org.springframework.web.servlet.mvc.WebContentInterceptor
WebContentInterceptor | public class WebContentInterceptor extends WebContentGenerator implements HandlerInterceptor(Code) | | 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.
author: Juergen Hoeller since: 27.11.2003 See Also: AbstractController |
Method Summary | |
public void | afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) 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. | public void | postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) This implementation is empty. | public boolean | preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) | public void | setAlwaysUseFullPath(boolean alwaysUseFullPath) Set if URL lookup should always use full path within current servlet
context. | 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. | public void | setPathMatcher(PathMatcher pathMatcher) Set the PathMatcher implementation to use for matching URL paths
against registered URL patterns, for determining cache mappings. | public void | setUrlDecode(boolean urlDecode) Set if context path and request URI should be URL-decoded. | public void | setUrlPathHelper(UrlPathHelper urlPathHelper) Set the UrlPathHelper to use for resolution of lookup paths. |
lookupCacheSeconds | protected Integer lookupCacheSeconds(String urlPath)(Code) | | 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.
Parameters: urlPath - URL the bean is mapped to the associated cache seconds, or null if not found See Also: org.springframework.util.AntPathMatcher |
setCacheMappings | public void setCacheMappings(Properties cacheMappings)(Code) | | 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.
Parameters: cacheMappings - a mapping between URL paths (as keys) andcache seconds (as values, need to be integer-parsable) See Also: WebContentInterceptor.setCacheSeconds See Also: org.springframework.util.AntPathMatcher |
setUrlDecode | public void setUrlDecode(boolean urlDecode)(Code) | | 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).
Note: Setting this to "true" requires JDK 1.4 if the encoding differs
from the VM's platform default encoding, as JDK 1.3's URLDecoder class
does not offer a way to specify the encoding.
Only relevant for the "cacheMappings" setting.
See Also: WebContentInterceptor.setCacheMappings See Also: org.springframework.web.util.UrlPathHelper.setUrlDecode |
Methods inherited from org.springframework.web.servlet.support.WebContentGenerator | final protected void applyCacheSeconds(HttpServletResponse response, int seconds)(Code)(Java Doc) final protected void applyCacheSeconds(HttpServletResponse response, int seconds, boolean mustRevalidate)(Code)(Java Doc) final protected void cacheForSeconds(HttpServletResponse response, int seconds)(Code)(Java Doc) final protected void cacheForSeconds(HttpServletResponse response, int seconds, boolean mustRevalidate)(Code)(Java Doc) final protected void checkAndPrepare(HttpServletRequest request, HttpServletResponse response, boolean lastModified) throws ServletException(Code)(Java Doc) final protected void checkAndPrepare(HttpServletRequest request, HttpServletResponse response, int cacheSeconds, boolean lastModified) throws ServletException(Code)(Java Doc) final public int getCacheSeconds()(Code)(Java Doc) final public String[] getSupportedMethods()(Code)(Java Doc) final public boolean isRequireSession()(Code)(Java Doc) final public boolean isUseCacheControlHeader()(Code)(Java Doc) final public boolean isUseExpiresHeader()(Code)(Java Doc) final protected void preventCaching(HttpServletResponse response)(Code)(Java Doc) final public void setCacheSeconds(int seconds)(Code)(Java Doc) final public void setRequireSession(boolean requireSession)(Code)(Java Doc) final public void setSupportedMethods(String[] methods)(Code)(Java Doc) final public void setUseCacheControlHeader(boolean useCacheControlHeader)(Code)(Java Doc) final public void setUseExpiresHeader(boolean useExpiresHeader)(Code)(Java Doc)
|
|
|