Package org.apache.catalina.core
Class ContextNamingInfoListener
java.lang.Object
org.apache.catalina.core.ContextNamingInfoListener
- All Implemented Interfaces:
LifecycleListener
Implementation of
LifecycleListener
that will create context naming information environment entries.
This listener must only be nested within Context
elements.
The following entries will be added to the initial context (java:comp/env
implied):
- Path:
context/path
fromContext.getPath()
- Encoded Path:
context/encodedPath
fromContext.getEncodedPath()
- Webapp Version:
context/webappVersion
fromContext.getWebappVersion()
- Name:
context/name
fromContainer.getName()
- Base Name:
context/baseName
fromContext.getBaseName()
- Display Name:
context/displayName
fromContext.getDisplayName()
See the Tomcat documentation for more details on the values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets whether paths and name for the root context will be empty.void
lifecycleEvent
(LifecycleEvent event) Acknowledge the occurrence of the specified event.void
setEmptyOnRoot
(boolean emptyOnRoot) Sets whether for the root contextcontext/path
andcontext/encodedPath
will contain"/"
andcontext/name
will contain"ROOT"
with a version, if any.
-
Constructor Details
-
ContextNamingInfoListener
public ContextNamingInfoListener()
-
-
Method Details
-
setEmptyOnRoot
public void setEmptyOnRoot(boolean emptyOnRoot) Sets whether for the root contextcontext/path
andcontext/encodedPath
will contain"/"
andcontext/name
will contain"ROOT"
with a version, if any.- Parameters:
emptyOnRoot
- whether paths and name for root context shall be empty
-
isEmptyOnRoot
public boolean isEmptyOnRoot()Gets whether paths and name for the root context will be empty.- Returns:
- indicator whether paths and name for the root context will be empty
-
lifecycleEvent
Description copied from interface:LifecycleListener
Acknowledge the occurrence of the specified event.- Specified by:
lifecycleEvent
in interfaceLifecycleListener
- Parameters:
event
- LifecycleEvent that has occurred
-