public class HttpHeaderSecurityFilter extends FilterBase
sm
Constructor and Description |
---|
HttpHeaderSecurityFilter() |
Modifier and Type | Method and Description |
---|---|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
The
doFilter method of the Filter is called by the container
each time a request/response pair is passed through the chain due to a
client request for a resource at the end of the chain. |
java.lang.String |
getAntiClickJackingOption() |
java.lang.String |
getAntiClickJackingUri() |
int |
getHstsMaxAgeSeconds() |
protected Log |
getLogger() |
void |
init(FilterConfig filterConfig)
Called by the web container to indicate to a filter that it is being
placed into service.
|
boolean |
isAntiClickJackingEnabled() |
boolean |
isBlockContentTypeSniffingEnabled() |
protected boolean |
isConfigProblemFatal()
Determines if an exception when calling a setter or an unknown
configuration attribute triggers the failure of the this filter which in
turn will prevent the web application from starting.
|
boolean |
isHstsEnabled() |
boolean |
isHstsIncludeSubDomains() |
void |
setAntiClickJackingEnabled(boolean antiClickJackingEnabled) |
void |
setAntiClickJackingOption(java.lang.String antiClickJackingOption) |
void |
setAntiClickJackingUri(java.lang.String antiClickJackingUri) |
void |
setBlockContentTypeSniffingEnabled(boolean blockContentTypeSniffingEnabled) |
void |
setHstsEnabled(boolean hstsEnabled) |
void |
setHstsIncludeSubDomains(boolean hstsIncludeSubDomains) |
void |
setHstsMaxAgeSeconds(int hstsMaxAgeSeconds) |
destroy
public void init(FilterConfig filterConfig) throws ServletException
javax.servlet.Filter
init
in interface Filter
init
in class FilterBase
ServletException
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
javax.servlet.Filter
doFilter
method of the Filter is called by the container
each time a request/response pair is passed through the chain due to a
client request for a resource at the end of the chain. The FilterChain
passed in to this method allows the Filter to pass on the request and
response to the next entity in the chain.
A typical implementation of this method would follow the following
pattern:-
1. Examine the request
2. Optionally wrap the request object with a custom implementation to
filter content or headers for input filtering
3. Optionally wrap the response object with a custom implementation to
filter content or headers for output filtering
4. a) Either invoke the next entity in the chain using
the FilterChain object (chain.doFilter()
),
4. b) or not pass on the request/response pair to the
next entity in the filter chain to block the request processing
5. Directly set headers on the response after invocation of the next
entity in the filter chain.
java.io.IOException
ServletException
protected Log getLogger()
getLogger
in class FilterBase
protected boolean isConfigProblemFatal()
FilterBase
isConfigProblemFatal
in class FilterBase
true
if a problem should trigger the failure of this
filter, else false
public boolean isHstsEnabled()
public void setHstsEnabled(boolean hstsEnabled)
public int getHstsMaxAgeSeconds()
public void setHstsMaxAgeSeconds(int hstsMaxAgeSeconds)
public boolean isHstsIncludeSubDomains()
public void setHstsIncludeSubDomains(boolean hstsIncludeSubDomains)
public boolean isAntiClickJackingEnabled()
public void setAntiClickJackingEnabled(boolean antiClickJackingEnabled)
public java.lang.String getAntiClickJackingOption()
public void setAntiClickJackingOption(java.lang.String antiClickJackingOption)
public java.lang.String getAntiClickJackingUri()
public boolean isBlockContentTypeSniffingEnabled()
public void setBlockContentTypeSniffingEnabled(boolean blockContentTypeSniffingEnabled)
public void setAntiClickJackingUri(java.lang.String antiClickJackingUri)
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.