Class webAppRootListener
- All Implemented Interfaces:
jakarta.servlet.ServletContextListener, EventListener
Can be used for toolkits that support substitution with system properties (i.e. System.getProperty values), like log4j's "${key}" syntax within log file locations.
Note: This listener should be placed before ContextLoaderListener in web.xml,
at least when used for log4j. Log4jConfigListener sets the system property
implicitly, so there's no need for this listener in addition to it.
WARNING: Some containers, for example, Tomcat, do NOT keep system properties separate per web app. You have to use unique "webAppRootKey" context-params per web app then, to avoid clashes. Other containers do isolate each web app's system properties: Here you can use the default key (i.e. no "webAppRootKey" context-param at all) without worrying.
WARNING: The WAR file containing the web application needs to be expanded to allow for setting the web app root system property. This is by default not the case when a WAR file gets deployed to webLogic, for example. Do not use this listener in such an environment!
- Since:
- 18.04.2003
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextDestroyed(jakarta.servlet.ServletContextEvent event) voidcontextInitialized(jakarta.servlet.ServletContextEvent event)
-
Constructor Details
-
webAppRootListener
public webAppRootListener()
-
-
Method Details
-
contextInitialized
public void contextInitialized(jakarta.servlet.ServletContextEvent event) - Specified by:
contextInitializedin interfacejakarta.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(jakarta.servlet.ServletContextEvent event) - Specified by:
contextDestroyedin interfacejakarta.servlet.ServletContextListener
-