Package com.aoapps.servlet.lastmodified
Class LastModifiedHeaderFilter
java.lang.Object
com.aoapps.servlet.lastmodified.LastModifiedHeaderFilter
- All Implemented Interfaces:
Filter
Adds
cache-control
and Link: <…>; rel="canonical"
headers to any request with a LastModifiedServlet.LAST_MODIFIED_PARAMETER_NAME parameter.
The headers are added before the filter chain is called.
This should be used for the DispatcherType.REQUEST dispatcher only.
Init Parameters:
cache-control: The content of the cache-control header,
defaults to "public,max-age=31557600,max-stale=31557600,stale-while-revalidate=31557600,stale-if-error=31557600,immutable"
See also:
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default, very aggressive,cache-controlheader value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(ServletRequest request, ServletResponse response, FilterChain chain) voidinit(FilterConfig config)
-
Field Details
-
DEFAULT_CACHE_CONTROL
The default, very aggressive,cache-controlheader value.- See Also:
-
-
Constructor Details
-
LastModifiedHeaderFilter
public LastModifiedHeaderFilter()
-
-
Method Details
-
init
-
doFilter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException - Specified by:
doFilterin interfaceFilter- Throws:
IOExceptionServletException
-
destroy
public void destroy()
-
