org.apache.shiro.web.servlet
Class NameableFilter
java.lang.Object
org.apache.shiro.web.servlet.ServletContextSupport
org.apache.shiro.web.servlet.AbstractFilter
org.apache.shiro.web.servlet.NameableFilter
- All Implemented Interfaces:
- javax.servlet.Filter, Nameable
- Direct Known Subclasses:
- OncePerRequestFilter
public abstract class NameableFilter
- extends AbstractFilter
- implements Nameable
Allows a filter to be named via JavaBeans-compatible
getName()/setName(String) methods. If no name is specified, the name of the filter will
default to the name given to it in web.xml (the FilterConfig's
filterName).
- Since:
- 1.0
| Methods inherited from interface javax.servlet.Filter |
doFilter |
NameableFilter
public NameableFilter()
getName
protected String getName()
- Returns the filter's name.
Unless overridden by calling the
setName(String) method, this value defaults to the
filter name as specified by the servlet container at start-up:
this.name = getFilterConfig().getName();
- Returns:
- the filter name, or
null if none available - See Also:
GenericServlet.getServletName(),
FilterConfig.getFilterName()
setName
public void setName(String name)
- Sets the filter's name.
Unless overridden by calling this method, this value defaults to the filter name as specified by the
servlet container at start-up:
this.name = getFilterConfig().getName();
- Specified by:
setName in interface Nameable
- Parameters:
name - the name of the filter.
toStringBuilder
protected StringBuilder toStringBuilder()
- Returns a StringBuilder instance with the
name, or if the name is null, just the
super.toStringBuilder() instance.
- Overrides:
toStringBuilder in class ServletContextSupport
- Returns:
- a StringBuilder instance to use for appending String data that will eventually be returned from a
toString() invocation.
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.