org.springframework.security.web.header
Class HeaderWriterFilter

java.lang.Object
  extended by org.springframework.web.filter.GenericFilterBean
      extended by org.springframework.web.filter.OncePerRequestFilter
          extended by org.springframework.security.web.header.HeaderWriterFilter
All Implemented Interfaces:
javax.servlet.Filter, Aware, BeanNameAware, DisposableBean, InitializingBean, EnvironmentAware, ServletContextAware

public class HeaderWriterFilter
extends OncePerRequestFilter

Filter implementation to add headers to the current request. Can be useful to add certain headers which enable browser protection. Like X-Frame-Options, X-XSS-Protection and X-Content-Type-Options.

Since:
3.2

Field Summary
 
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
 
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
 
Constructor Summary
HeaderWriterFilter(List<HeaderWriter> headerWriters)
          Creates a new instance.
 
Method Summary
protected  void doFilterInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)
           
 
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
 
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderWriterFilter

public HeaderWriterFilter(List<HeaderWriter> headerWriters)
Creates a new instance.

Parameters:
headerWriters - the HeaderWriter instances to write out headers to the HttpServletResponse.
Method Detail

doFilterInternal

protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                javax.servlet.FilterChain filterChain)
                         throws javax.servlet.ServletException,
                                IOException
Specified by:
doFilterInternal in class OncePerRequestFilter
Throws:
javax.servlet.ServletException
IOException