Filterpublic class HeaderFilter extends IncludeExcludeBasedFilter
This filter sets or adds a header to the response.
The headerConfig init param is a CSV of actions to perform on headers, with the following syntax:
[action] [header name]: [header value]
[action] can be one of set, add, setDate, or addDate
The date actions will add the header value in milliseconds to the current system time before setting a date header.
Below is an example value for headerConfig:
set X-Frame-Options: DENY, "add Cache-Control: no-cache, no-store, must-revalidate", setDate Expires: 31540000000, addDate Date: 0
IncludeExcludeBasedFilter| Constructor | Description |
|---|---|
HeaderFilter() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain) |
|
void |
init(FilterConfig filterConfig) |
|
java.lang.String |
toString() |
destroy, guessMimeType, shouldFilterpublic void init(FilterConfig filterConfig) throws ServletException
init in interface Filterinit in class IncludeExcludeBasedFilterServletExceptionpublic void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
java.io.IOExceptionServletExceptionpublic java.lang.String toString()
toString in class IncludeExcludeBasedFilterCopyright © 1995–2018 Webtide. All rights reserved.