To display the top page only by specifying the domain name, you need to deploy the welcome file in the root context. Root context refers to a context whose context root# is a null character (name is not specified in the context root).
- #
- The unit of management that compile the Web applications is called a context. The root path of this context is called a context root. When accessing a Web application, specify the context root on the URL.
- The following figure explains the context and the context root:
Figure 4-23 Context and context root
The following settings are required to display the top page only by specifying the domain name:
- Settings of the redirector
The root context is accessed via the Web server. Consequently, you need to specify the settings in the URL mapping definition of the redirector, so that the corresponding URL is redirected. Specify the settings in either mod_jk.conf (in Cosminexus HTTP Server) or uriworkermap.properties (in Microsoft IIS).
- Settings of the application
Specify a null character in the context root of the imported J2EE application.
Notes
Note the following points when using the 'Viewing the top page by specifying the domain name' functionality:
- Accessed hierarchy when the context root and the root context have the same hierarchies
When the context root and the root context have the same hierarchies, the hierarchy of the context root is accessed. An example is shown below.
- Example:
- In this example, the context root of Web application A is 'example', while the context root of Web application B is a null character, and both the Web applications have the hierarchy called 'example'.
Figure 4-24 Example of accessed hierarchy when the context root and root context have the same hierarchies
- In this case, when 'http://host-name/example' is accessed, example/index.jsp of Web application A that has a context root is executed.
- If, however, the directory contains "forward" and "include", and for example "forward" in the directory is accessed, URL is forwarded to the index.jsp of the root context.
- Configuration in the Web application
You cannot use 'ejb' and 'web' at the beginning of the URL.
- Examples of URLs in which you cannot use the 'ejb' and 'web' at the beginning:
- http://host-name:port-number/ejb/
- http://host-name:port-number/web/
For this reason, do not configure a Web application to be deployed as the root context, so that 'ejb' or 'web' is at the beginning.
- How to display in a message text
In the messages output to the console and log files, the context root is displayed as a null character.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.