Abstract
A URL is used to access Web modules from a browser. This tip shows you how to navigate through the WebSphere Administrative Console to find the information needed to determine the URL for an application, servlet, or JSP.
Contents
The URL for an application, servlet, or JSP is the path used to access it from a browser. To determine the elements required to make up the URL you will need to look in more than one place in the Administrative Console.
Determining the URL needed to access an application can be done using the following steps:
- Find the context root of the Web module containing the servlet.
- Find the virtual host where the Web module is installed.
- Find the aliases by which the virtual host is known.
- Combine the virtual host alias and context root to form the URL request:
http://<virtual_host_alias>/<context_root>
If you are navigating to a particular servlet or JSP you will need to add one step to the process:
- Find the URL for the servlet or JSPs.
- Combine the virtual host alias, context root, and servlet URL to form the URL request:
http://<virtual_host_alias>/<context_root>/<servlet_URL>
As an example, take the snoop servlet. The snoop servlet is shipped in the DefaultWebApplication Web module of the DefaultApplication enterprise application.
Step 1: Find the context root of the Web module
- From the Administrative Console, select Applications -> Enterprise Applications.
- Select the application, in our case DefaultApplication.
- On the Configuration tab select View Deployment Descriptor in the Additional Properties pane.
- Expand the Web modules until you find the Web module and its context root.
- In this case, the context root for the DefaultWebApplication.war Web module is "/". Note this and click Back to return to the DefaultApplication configuration.
Step 2: Find the URL for the servlet
- In the DefaultApplication configuration page, select Web Modules in the Related Items pane.
- Click the DefaultWebApplication Web module to see the general properties.
- Click View Deployment Descriptor in the Additional Properties pane.
- Expand the servlet mappings until you find the servlet. The URL pattern will be listed below the entry.
- In this case, the URL pattern for the snoop servlet starting from the Web module context root is “/snoop/*”. The Web module context root was “/”.
- Click Back to return to the Web module configuration page.
- As you navigate through the windows, a navigation path is displayed near the top of the window, below the Messages area. Click DefaultApplication to return to the configuration page.
If you haven't defined any virtual hosts and assign all applications to the default_host virtual host, then you can skip this step.
- In the DefaultApplication configuration page, select Map virtual hosts for web modules in the Additional Properties pane. This will display the Web modules and the virtual hosts they will run in.
- In this case, the DefaultWebApplication Web module has been installed on the default_host virtual host.
Step 4: Find the host aliases
- From the Console navigation tree, select Environment -> Virtual Hosts.
- Click the virtual host for the Web module, in this case, default_host.
- Select Host Aliases in the Additional Properties pane. This shows the list of aliases by which the default_host virtual host is known.
- The aliases are composed of a DNS host name and a port number. The host aliases for the default_host virtual host are *:80, *:9080 and *:9443, “*” meaning any URL that specifies ports 80, 9080, or 9443 will match.
Step 5: Combine the elements to form the URL
- Combine the virtual host alias, context root and URL pattern to form the URL request of the snoop servlet.
Since the context root is "/", you will see no real effect in the URL pattern. Requests for the servlet with any of the following URLs will map to the default_host virtual host:
http://<hostname>:80/snoop
http://<hostname>:9080/snoop
https://<hostname>:9443/snoop
Special Notices
This material has not been submitted to any formal IBM test and is published AS IS. It has not been the subject of rigorous review. IBM assumes no responsibility for its accuracy or completeness. The use of this information or the implementation of any of these techniques is a client responsibility and depends upon the client's ability to evaluate and integrate them into the client's operational environment.
