public class AllowAnyOriginFilter
extends java.lang.Object
implements javax.servlet.Filter
Requests from any origin are allowed. The requests are allowed to contain credentials and
the Content-Type
header.
When configuring servlets via web.xml
, users can add this filter to the requested
servlets.
When configuring servlets via annotations, users can extend this class and mark the subtype
with the javax.servlet.annotation.WebFilter
annotation.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ANY_URL
A URL pattern which matches all the URLs.
|
static java.lang.String |
NAME
The human readable name of this filter.
|
Constructor and Description |
---|
AllowAnyOriginFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
void |
init(javax.servlet.FilterConfig filterConfig) |
public static final java.lang.String NAME
public static final java.lang.String ANY_URL
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
public void init(javax.servlet.FilterConfig filterConfig)
init
in interface javax.servlet.Filter
public void destroy()
destroy
in interface javax.servlet.Filter