public abstract class GenericFilter extends java.lang.Object implements Filter, FilterConfig, java.io.Serializable
Constructor and Description |
---|
GenericFilter() |
Modifier and Type | Method and Description |
---|---|
FilterConfig |
getFilterConfig()
Obtain the FilterConfig used to initialise this Filter instance.
|
java.lang.String |
getFilterName()
Get the name of the filter.
|
java.lang.String |
getInitParameter(java.lang.String name)
Returns a
String containing the value of the named
initialization parameter, or null if the parameter does not
exist. |
java.util.Enumeration<java.lang.String> |
getInitParameterNames()
Returns the names of the filter's initialization parameters as an
Enumeration of String objects, or an empty
Enumeration if the filter has no initialization parameters. |
ServletContext |
getServletContext()
Returns a reference to the
ServletContext in which the caller is
executing. |
void |
init()
Convenience method for sub-classes to save them having to call
super.init(config) . |
void |
init(FilterConfig filterConfig)
Called by the web container to indicate to a filter that it is being
placed into service.
|
public java.lang.String getInitParameter(java.lang.String name)
FilterConfig
String
containing the value of the named
initialization parameter, or null
if the parameter does not
exist.getInitParameter
in interface FilterConfig
name
- String
specifying the name of the initialization
parameterString
containing the value of the initialization
parameterpublic java.util.Enumeration<java.lang.String> getInitParameterNames()
FilterConfig
Enumeration
of String
objects, or an empty
Enumeration
if the filter has no initialization parameters.getInitParameterNames
in interface FilterConfig
Enumeration
of String
objects
containing the names of the filter's initialization parameterspublic FilterConfig getFilterConfig()
init(FilterConfig)
methodpublic ServletContext getServletContext()
FilterConfig
ServletContext
in which the caller is
executing.getServletContext
in interface FilterConfig
ServletContext
object, used by the caller to interact
with its servlet containerServletContext
public void init(FilterConfig filterConfig) throws ServletException
Filter
The web container cannot place the filter into service if the init method either:
init
in interface Filter
filterConfig
- The configuration information associated with the
filter instance being initialisedServletException
- if the initialisation failspublic void init() throws ServletException
super.init(config)
. This is a NO-OP by default.ServletException
- If an exception occurs that interrupts the
Filter's normal operationpublic java.lang.String getFilterName()
FilterConfig
getFilterName
in interface FilterConfig
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.