9.11.1 Defining the context root of a J2EE application
You define the context root of a J2EE application.
You can also define the root context in the context root. Root context is a context of a context root with blank characters "". If a welcome file is created in the root context, the home page of the J2EE application can be displayed from a URL with only the domain name, like http: //www.cosminexus.com/.
- Organization of this subsection
(1) Attribute file to be edited
WAR attribute file
(2) Acquiring the attribute file to be edited and setting the attributes
-
Acquiring the attribute file
Execute the following command to acquire a WAR attribute file:
- Execution format
cjgetappprop [server-name] [-nameserver provider-URL] -name J2EE application-name -type war -resname WAR-display-name -c path-of-the-WAR-attribute-file
- Example of execution
cjgetappprop MyServer -name adder -type war -resname adder_war -c C:\home\adder_war.xml
-
Setting the attributes
Execute the following command to apply the values of the WAR attribute file:
- Execution format
cjsetappprop [server-name] [-nameserver provider-URL] -name J2EE application-name -type war -resname WAR-display-name -c path-of-the-WAR-attribute-file
- Example of execution
cjsetappprop MyServer -name adder -type war -resname adder_war -c C:\home\adder_war.xml
(3) Attribute settings to be edited
The following table describes the property settings for context root definition (<runtime>) of the J2EE application:
Item |
Mandatory |
Corresponding tag |
---|---|---|
Context root |
Y |
<context-root> |
For details on the property settings, see 3.7.1 Specifications of the HITACHI WAR Property file in the uCosminexus Application Server Application and Resource Definition Reference Guide.
(4) Notes
-
Do not specify strings beginning with "ejb/", or "web/" in the context root.
If the components of the context root path in multiple J2EE applications have an inclusion relation (for example: "test" and "test/jsp") and if a URL (for example: "/test/jsp/test.jsp") containing the path to be included is specified and accessed, then the application (in the example, path that has "test/jsp" in the context root) of the path to be included is enabled and the application of the included path cannot be accessed.
-
Context root is used as the directory name in the working directory. Specify the context root so that the path length of the working directory does not reach the upper limit set for the platform. For details on estimating the path length of the working directory, see C.1 Work directory of the J2EE server in the uCosminexus Application Server System Setup and Operation Guide.
-
In the Web application that is started by using the root context, do not use a configuration in which the URL begins with "ejb" or "web".
-
In the messages that are output to the console and the log file, the context root of root context is displayed by blank characters '""'.