Setting Context Properties
See Also
The Context property sheet enables you to edit the attributes
of a Context.
To display the Context property sheet:
- On the Runtime tab of the Explorer, expand the Installed Servers node.
- Expand the Tomcat node, then expand the relevant installation node,
then expand the node for the Host containing the desired Context.
- Right click on the Context to be edited, and choose Properties from the
contextual menu.
On the Attributes pane of the Context property sheet, you can
set the following properties:
- className. This property specfies the java class name of the implementation
to use. The default className is org.apache.catalina.core.Standard.Context.
- cookies. If cookies is set to true, cookies are used
for session identifier communication if supported by the client. This is the
default behavior. If false, cookies are disabled in favor of
URL rewriting by the application. To set the cookies property, click on the
right-hand column of the cookies row and choose a value from the list.
- crossContext. The crossContext property allows you to use other servlet
contexts with the ServletContext.getContext() method. If crossContext
is set to true, calls within the current application to ServletContext.getContext()
successfully return a request dispatcher for other web modules running on
the current virtual host. In high-security environments, you should set the
property to false so that getContext() will always
return null. This is the default behavior. To set the crossContext property,
click on the right-hand column of the crossContext row and choose a value
from the list.
- debug. This property specifies the level of debugging detail logged
by the current engine to the associated logger. Higher numbers generate more
detailed output. If not specified, the default debugging detail level is 0.
To specify the debug property, type a number in the right-hand column of the
debug property row.
- docBase. This property points to the location of the web
module. It can be one of the following:
- The absolute path to the directory that contains the
web module source or its binaries.
- The absolute path to the web module's WAR file.
- override. If override is set to true, any explicit settings
in this Context element will override any corresponding settings
in the DefaultContext element associated with the owning Host.
If set to false, settings in the DefaultContext
will be used. The default setting for this property is false.
To set the override property, click on the right-hand column of the override
row and choose a value from the list.
- path. Use this property to set the context root for the current web
module. The web module's context path is derived by combining the
DNS name of the server with the web module's context root.
For example, if the path
is /directives, then the context path is
http://host:port/directives.
The server uses the context root to locate a specific web module among all
the web modules that are deployed on the server. Therefore,
all of the context
paths within a particular Host must be unique. To set the path
property, type a path in the path property text field. If you specify a context
path of an empty string, such as (""), you are defining
the default web module for the current Host, which will process all requests
not assigned to other contexts.
- privileged. If set to true, the privileged property
allows the current context to use container servlets, like the manager servlet.
The default value is false. To set the privileged property, click
on the right-hand column of the privileged row and choose a value from the
list.
- reloadable. If set to true, Catalina will monitor classes
in WEB-INF/classes and WEB-INF/lib for changes,
and automatically reload the web module if a change is detected. This feature
is useful, but not recommended for use on deployed production web modules
because of significant runtime overhead. To set the reloadable property, click
on the right-hand column of the reloadable row and choose a value from the
list.
- useNaming. If set to true, Catalina enables a JNDI InitialContext
for the current web module. To set the useNaming property, click on the right-hand
column of the useNaming row and choose a value from the list.
- workDir. The workDir property is the pathname to a scratch
directory to be provided for the current Context for temporary
read-write use by servlets within the associated web module. This directory
will be made visible to servlets in the web module by a servlet context attribute
named javax.servlet.context.tempdir. To specify the workDir property,
type a path in the workDir property text field.
- wrapperClass. This read-only property specifies the Java class name
of the org.apache.catalina.Wrapper implementation class that
will be used for servlets managed by this Context. The default value is
org.apache.catalina.core.StandardWrapper.
Legal Notices