public class PluginFilter extends Object implements javax.servlet.Filter
PluginFilter.SimpleFilter
only has the ability to use the ServletRequest
and ServletResponse objects and then return true if further filters in the chain should be run.
The new, non-deprecated functionality allows for regular Filter
instances to be registered with this class,
which removes much of the limitations that was present in the SimpleFilter approach.
This implementation assumes, but does not enforce, that filters installed by plugins are applied to URL patterns that
match the plugin. When filters installed by different plugins are applied to the same URL, the behavior of this
implementation is undetermined.Modifier and Type | Class and Description |
---|---|
static interface |
PluginFilter.SimpleFilter
Deprecated.
Use
Filter instead. |
Constructor and Description |
---|
PluginFilter() |
Modifier and Type | Method and Description |
---|---|
static void |
addPluginFilter(PluginFilter.SimpleFilter filter)
Deprecated.
Replaced by
addPluginFilter(String, Filter) |
static void |
addPluginFilter(String filterUrl,
javax.servlet.Filter filter)
Adds a filter to the list of filters that will be run on every request of which the URL matches the URL that
is registered with this filter.
|
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
This class is a Filter implementation itself.
|
void |
init(javax.servlet.FilterConfig filterConfig) |
static void |
removePluginFilter(PluginFilter.SimpleFilter filter)
Deprecated.
|
static javax.servlet.Filter |
removePluginFilter(String filterUrl,
String filterClassName)
Removes a filter that is applied to a certain URL.
|
@Deprecated public static void addPluginFilter(PluginFilter.SimpleFilter filter)
addPluginFilter(String, Filter)
filter
- the filter.public static void addPluginFilter(String filterUrl, javax.servlet.Filter filter)
filterUrl
- The URL pattern to which the filter is to be applied. Cannot be null nor an empty string.filter
- The filter. Cannot be null.@Deprecated public static void removePluginFilter(PluginFilter.SimpleFilter filter)
filter
- the filter.public static javax.servlet.Filter removePluginFilter(String filterUrl, String filterClassName)
filterUrl
- The URL pattern to which the filter is applied. Cannot be null nor an empty string.filterClassName
- The filter class name. Cannot be null or empty string.public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter
Copyright © 2003-2008 Jive Software.