public final class WebPBEInitializationContextListener extends Object implements 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 WebPBEConfig
objects.
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.
Modifier and Type | Field and Description |
---|---|
static String |
INIT_PARAM_INITIALIZER_CLASS_NAME |
Constructor and Description |
---|
WebPBEInitializationContextListener() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(ServletContextEvent sce)
Receives notification that the ServletContext is about to be shut down.
|
void |
contextInitialized(ServletContextEvent sce)
Receives notification that the web application initialization process is starting.
|
public static final String INIT_PARAM_INITIALIZER_CLASS_NAME
public void contextDestroyed(ServletContextEvent sce)
ServletContextListener
All servlets and filters will have been destroyed before any ServletContextListeners are notified of context destruction.
contextDestroyed
in interface ServletContextListener
sce
- the ServletContextEvent containing the ServletContext that is being destroyedpublic void contextInitialized(ServletContextEvent sce)
ServletContextListener
All ServletContextListeners are notified of context initialization before any filters or servlets in the web application are initialized.
contextInitialized
in interface ServletContextListener
sce
- the ServletContextEvent containing the ServletContext that is being initializedCopyright © 2021 JBoss by Red Hat. All rights reserved.