Class ShiroFilter

  • All Implemented Interfaces:
    Filter, Nameable

    public class ShiroFilter
    extends AbstractShiroFilter
    Primary Shiro Filter for web applications configuring Shiro via Servlet <listener> in web.xml.

    As of Shiro 1.2, this is Shiro's preferred filter for web.xml configuration. It expects the presence of a Shiro WebEnvironment in the ServletContext, also configured via web.xml.


    As this Filter expects an available WebEnvironment instance to be configured, it must be defined in web.xml with the companion EnvironmentLoaderListener, which performs the necessary environment setup. For example:
     <-- Filter all web requests.  This filter mapping is typically declared
         before all others to ensure any other filters are secured as well: -->
    Configuration options (configuration file paths, etc) are specified as part of the EnvironmentLoaderListener configuration. See the EnvironmentLoader JavaDoc for configuration options.
    See Also:
    EnvironmentLoader, EnvironmentLoaderListener, Apache Shiro Web Documentation