Package org.eclipse.jetty.ee10.servlets
Class HeaderFilter
java.lang.Object
org.eclipse.jetty.ee10.servlets.IncludeExcludeBasedFilter
org.eclipse.jetty.ee10.servlets.HeaderFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
Header Filter
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
- See Also:
-
Constructor Summary
-
Method Summary
Methods inherited from class org.eclipse.jetty.ee10.servlets.IncludeExcludeBasedFilter
destroy, guessMimeType, shouldFilter
-
Constructor Details
-
HeaderFilter
public HeaderFilter()
-
-
Method Details
-
init
public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException - Specified by:
init
in interfacejakarta.servlet.Filter
- Overrides:
init
in classIncludeExcludeBasedFilter
- Throws:
jakarta.servlet.ServletException
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Throws:
IOException
jakarta.servlet.ServletException
-
toString
- Overrides:
toString
in classIncludeExcludeBasedFilter
-