public abstract class GenericHttpFilter extends Object implements javax.servlet.Filter, Initializing, Disposable
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger
Logger available to subclasses
|
| Constructor and Description |
|---|
GenericHttpFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addRequiredProperty(String property)
Subclasses can invoke this method to specify that this property (which
must match a JavaBean property they expose) is mandatory, and must be
supplied as a config parameter.
|
void |
destroy()
Subclasses may override this to perform custom filter shutdown.
|
javax.servlet.FilterConfig |
getFilterConfig()
Make the FilterConfig of this filter available, if any.
|
protected String |
getFilterName()
Make the name of this filter available to subclasses.
|
protected javax.servlet.ServletContext |
getServletContext()
Make the ServletContext of this filter available to subclasses.
|
void |
init()
Calls the
initFilterBean() method that might contain custom
initialization of a subclass. |
void |
init(javax.servlet.FilterConfig filterConfig)
Standard way of initializing this filter.
|
protected void |
initFilterBean()
Subclasses may override this to perform custom initialization.
|
protected void |
initParams(javax.servlet.FilterConfig config) |
public void init()
throws Exception
initFilterBean() method that might contain custom
initialization of a subclass.
Only relevant in case of initialization as bean, where the standard
init(FilterConfig) method won't be called.
init in interface InitializingExceptioninitFilterBean(),
init(javax.servlet.FilterConfig)protected final void addRequiredProperty(String property)
This method is only relevant in case of traditional initialization driven by a FilterConfig instance.
property - name of the required propertypublic final void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.FilterfilterConfig - the configuration for this filterjavax.servlet.ServletException - if bean properties are invalid (or required properties are
missing), or if subclass initialization fails.initFilterBean()protected void initParams(javax.servlet.FilterConfig config)
throws javax.servlet.ServletException
javax.servlet.ServletExceptionpublic final javax.servlet.FilterConfig getFilterConfig()
getServletConfig().
Public to resemble the getFilterConfig() method of the Servlet Filter version that
shipped with WebLogic 6.1.
null if none availableGenericServlet.getServletConfig()protected final String getFilterName()
getServletName().
Takes the FilterConfig's filter name by default. If initialized as bean in application context, it falls back to the bean name as defined in the bean factory.
null if none availableGenericServlet.getServletName(),
FilterConfig.getFilterName()protected final javax.servlet.ServletContext getServletContext()
getServletContext().
Takes the FilterConfig's ServletContext by default. If initialized as bean in application context, it falls back to the ServletContext that the bean factory runs in.
null if none
availableGenericServlet.getServletContext(),
FilterConfig.getServletContext()protected void initFilterBean()
throws javax.servlet.ServletException
Note: This method will be called from standard filter initialization as well as filter bean initialization in a application context. Filter name and ServletContext will be available in both cases.
This default implementation is empty.
javax.servlet.ServletException - if subclass initialization failsgetFilterName(),
getServletContext()public void destroy()
Note: This method will be called from standard filter destruction as well as filter bean destruction in a application context.
This default implementation is empty.
destroy in interface javax.servlet.Filterdestroy in interface DisposableCopyright © 2005–2018 The Beangle Software. All rights reserved.