Class CORSFilter
java.lang.Object
org.openremote.container.web.file.HttpFilter
org.openremote.container.security.CORSFilter
- All Implemented Interfaces:
javax.servlet.Filter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, javax.servlet.FilterChain chain) Filter the HTTP request.intvoidinit(javax.servlet.FilterConfig filterConfig) Called by the servlet container when the filter is about to be placed into service.booleanprotected booleanvoidsetAllowCredentials(boolean allowCredentials) voidsetAllowedHeaders(String allowedHeaders) voidsetAllowedMethods(String allowedMethods) voidsetAllowedOrigins(Set<String> allowedOrigins) voidsetCorsMaxAge(int corsMaxAge) voidsetExposedHeaders(String exposedHeaders) Methods inherited from class org.openremote.container.web.file.HttpFilter
doFilter, getFilterConfig, getInitParameter, getServletContext, init
-
Field Details
-
allowCredentials
protected boolean allowCredentials -
allowedMethods
-
allowedHeaders
-
exposedHeaders
-
corsMaxAge
protected int corsMaxAge -
allowedOrigins
-
-
Constructor Details
-
CORSFilter
public CORSFilter()
-
-
Method Details
-
isAllowCredentials
public boolean isAllowCredentials() -
setAllowCredentials
public void setAllowCredentials(boolean allowCredentials) -
getAllowedMethods
-
setAllowedMethods
-
getAllowedHeaders
-
setAllowedHeaders
-
getExposedHeaders
-
setExposedHeaders
-
getCorsMaxAge
public int getCorsMaxAge() -
setCorsMaxAge
public void setCorsMaxAge(int corsMaxAge) -
getAllowedOrigins
-
setAllowedOrigins
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException Description copied from class:HttpFilterCalled by the servlet container when the filter is about to be placed into service. This implementation stores theFilterConfigobject for later use by the getter methods. It's recommended to not override this method. Instead, just useHttpFilter.init()method. When overriding this method anyway, don't forget to callsuper.init(config), otherwise the getter methods will throw an illegal state exception.- Specified by:
initin interfacejavax.servlet.Filter- Overrides:
initin classHttpFilter- Throws:
javax.servlet.ServletException
-
doFilter
public void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, IOException Description copied from class:HttpFilterFilter the HTTP request. The session argument isnullif there is no session.- Specified by:
doFilterin classHttpFilter- Parameters:
request- The HTTP request.response- The HTTP response.session- The HTTP session, if any, elsenull.chain- The filter chain to continue.- Throws:
javax.servlet.ServletException- As wrapper exception when something fails in the request processing.IOException- Whenever something fails at I/O level.- See Also:
-
Filter.doFilter(ServletRequest, ServletResponse, FilterChain)
-
destroy
public void destroy()- Specified by:
destroyin interfacejavax.servlet.Filter- Overrides:
destroyin classHttpFilter
-
originOk
-