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 thecache-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
Modifier and TypeFieldDescriptionstatic final String
The default, very aggressive,cache-control
header value. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
void
doFilter
(ServletRequest request, ServletResponse response, FilterChain chain) void
init
(FilterConfig config)
-
Field Details
-
DEFAULT_CACHE_CONTROL
The default, very aggressive,cache-control
header 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:
doFilter
in interfaceFilter
- Throws:
IOException
ServletException
-
destroy
public void destroy()
-