Class EnvironmentLoaderListener

java.lang.Object
org.apache.shiro.web.env.EnvironmentLoader
org.apache.shiro.web.env.EnvironmentLoaderListener
All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener

public class EnvironmentLoaderListener extends EnvironmentLoader implements javax.servlet.ServletContextListener
Bootstrap listener to startup and shutdown the web application's Shiro WebEnvironment at ServletContext startup and shutdown respectively. This class exists only to implement the ServletContextListener interface. All 'real' logic is done in the parent EnvironmentLoader class.

Usage

Define the following in web.xml:
 <listener>
     <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
 </listener>
 
Configuration options, such as the WebEnvironment class to instantiate as well as Shiro configuration resource locations are specified as ServletContext context-params and are documented in the EnvironmentLoader JavaDoc.

Shiro Filter

This listener is almost always defined in conjunction with the ShiroFilter to ensure security operations for web requests. Please see the ShiroFilter JavaDoc for more.
Since:
1.2
See Also: