Class OncePerRequestFilter

java.lang.Object
All Implemented Interfaces:
javax.servlet.Filter, org.apache.shiro.lang.util.Nameable
Direct Known Subclasses:
AbstractShiroFilter, AdviceFilter

public abstract class OncePerRequestFilter extends NameableFilter
Filter base class that guarantees to be just executed once per request, on any servlet container. It provides a doFilterInternal(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) method with HttpServletRequest and HttpServletResponse arguments.

The getAlreadyFilteredAttributeName() method determines how to identify that a request is already filtered. The default implementation is based on the configured name of the concrete filter instance.

Controlling filter execution

1.2 introduced the isEnabled(javax.servlet.ServletRequest, javax.servlet.ServletResponse) method and isEnabled() property to allow explicit control over whether the filter executes (or allows passthrough) for any given request.

NOTE This class was initially borrowed from the Spring framework but has continued modifications.

Since:
0.1