Package com.avoka.fc.core.servlet
Class HeaderFilter
- java.lang.Object
-
- com.avoka.fc.core.servlet.HeaderFilter
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
CORS_APPLY_HEADERS
protected static String
CORS_APPROVED_ORIGINS
protected static String
CORS_CDN_URL
protected static String
CORS_EXCLUDED_PATHS
protected static String
CORS_HEADERS
protected static String
CORS_REQUEST_ORIGIN
-
Constructor Summary
Constructors Constructor Description HeaderFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Called by the web container to indicate to a filter that it is being taken out of service.void
doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
Call the filter chain then validates the response to ensure header has been added If not then adds the default one defined in the PortalProperty.void
init(FilterConfig filterConfig)
Called by the web container to indicate to a filter that it is being placed into service.
-
-
-
Field Detail
-
CORS_APPLY_HEADERS
protected static final String CORS_APPLY_HEADERS
- See Also:
- Constant Field Values
-
CORS_APPROVED_ORIGINS
protected static final String CORS_APPROVED_ORIGINS
- See Also:
- Constant Field Values
-
CORS_EXCLUDED_PATHS
protected static final String CORS_EXCLUDED_PATHS
- See Also:
- Constant Field Values
-
CORS_HEADERS
protected static final String CORS_HEADERS
- See Also:
- Constant Field Values
-
CORS_REQUEST_ORIGIN
protected static final String CORS_REQUEST_ORIGIN
- See Also:
- Constant Field Values
-
CORS_CDN_URL
protected static final String CORS_CDN_URL
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(FilterConfig filterConfig) throws ServletException
Called by the web container to indicate to a filter that it is being placed into service.- Specified by:
init
in interfaceFilter
- Parameters:
filterConfig
- the filter config- Throws:
ServletException
- if an error occurs during initiation.- See Also:
Filter.init(FilterConfig)
-
destroy
public void destroy()
Called by the web container to indicate to a filter that it is being taken out of service.- Specified by:
destroy
in interfaceFilter
- See Also:
Filter.destroy()
-
doFilter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException
Call the filter chain then validates the response to ensure header has been added If not then adds the default one defined in the PortalProperty.- Specified by:
doFilter
in interfaceFilter
- Parameters:
request
- the servlet requestresponse
- the servlet responsefilterChain
- the filter chain- Throws:
IOException
- if an I/O error occursServletException
- if a servlet error occurs
-
-