public class EnvironmentLoaderListener extends EnvironmentLoader implements javax.servlet.ServletContextListener
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.
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-param
s and are documented in the
EnvironmentLoader
JavaDoc.
ShiroFilter
to ensure security operations for web requests. Please
see the ShiroFilter
JavaDoc for more.EnvironmentLoader
,
ShiroFilter
CONFIG_LOCATIONS_PARAM, ENVIRONMENT_ATTRIBUTE_KEY, ENVIRONMENT_CLASS_PARAM
Constructor and Description |
---|
EnvironmentLoaderListener() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce)
Destroys any previously created/bound
WebEnvironment instance created by
the contextInitialized(javax.servlet.ServletContextEvent) method. |
void |
contextInitialized(javax.servlet.ServletContextEvent sce)
Initializes the Shiro
WebEnvironment and binds it to the ServletContext at application
startup for future reference. |
createEnvironment, customizeEnvironment, destroyEnvironment, determineWebEnvironmentClass, initEnvironment
public void contextInitialized(javax.servlet.ServletContextEvent sce)
WebEnvironment
and binds it to the ServletContext
at application
startup for future reference.contextInitialized
in interface javax.servlet.ServletContextListener
sce
- the ServletContextEvent triggered upon application startuppublic void contextDestroyed(javax.servlet.ServletContextEvent sce)
WebEnvironment
instance created by
the contextInitialized(javax.servlet.ServletContextEvent)
method.contextDestroyed
in interface javax.servlet.ServletContextListener
sce
- the ServletContextEvent triggered upon application shutdownCopyright © 2004–2016 The Apache Software Foundation. All rights reserved.