Package org.jasypt.web.pbeconfig
Class WebPBEInitializationContextListener
java.lang.Object
org.jasypt.web.pbeconfig.WebPBEInitializationContextListener
- All Implemented Interfaces:
EventListener
,javax.servlet.ServletContextListener
public final class WebPBEInitializationContextListener
extends Object
implements javax.servlet.ServletContextListener
ContextListener which takes a WebPBEInitializer
implementation
class name as a parameter (<context-param>) and calls its
initializeWebPBEConfigs() method to allow the webapp to
create its PBE encryptors and declare their associated
objects.
invalid reference
WebPBEConfig
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
contextDestroyed
(javax.servlet.ServletContextEvent sce) void
contextInitialized
(javax.servlet.ServletContextEvent sce)
-
Field Details
-
INIT_PARAM_INITIALIZER_CLASS_NAME
- See Also:
-
-
Constructor Details
-
WebPBEInitializationContextListener
public WebPBEInitializationContextListener()
-
-
Method Details
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent sce) - Specified by:
contextDestroyed
in interfacejavax.servlet.ServletContextListener
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent sce) - Specified by:
contextInitialized
in interfacejavax.servlet.ServletContextListener
-