Package org.jasypt.web.pbeconfig
Class WebPBEInitializationContextListener
- Object
-
- org.jasypt.web.pbeconfig.WebPBEInitializationContextListener
-
- All Implemented Interfaces:
java.util.EventListener,javax.servlet.ServletContextListener
public final class WebPBEInitializationContextListener extends Object implements javax.servlet.ServletContextListenerContextListener which takes a
WebPBEInitializerimplementation class name as a parameter (<context-param>) and calls its initializeWebPBEConfigs() method to allow the webapp to create its PBE encryptors and declare their associatedWebPBEConfigobjects.An example web.xml fragment:
<context-param> <param-name>webPBEInitializerClassName</param-name> <param-value>myapp.MyWebPBEInitializer</param-value> </context-param> <listener> <listener-class> org.jasypt.web.pbeconfig.WebPBEInitializationContextListener </listener-class> </listener>Important: If the web application uses Spring Framework, WebPBEConfig objects are declared as beans in the Spring context and this Spring context is initialized at application deploy time (with Spring's ContextLoaderListener), the use of this context listener will become unnecessary.
- Since:
- 1.3
- Author:
- Daniel Fernández
-
-
Field Summary
Fields Modifier and Type Field Description static StringINIT_PARAM_INITIALIZER_CLASS_NAME
-
Constructor Summary
Constructors Constructor Description WebPBEInitializationContextListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextDestroyed(javax.servlet.ServletContextEvent sce)voidcontextInitialized(javax.servlet.ServletContextEvent sce)
-
-
-
Field Detail
-
INIT_PARAM_INITIALIZER_CLASS_NAME
public static final String INIT_PARAM_INITIALIZER_CLASS_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent sce)
- Specified by:
contextDestroyedin interfacejavax.servlet.ServletContextListener
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent sce)
- Specified by:
contextInitializedin interfacejavax.servlet.ServletContextListener
-
-