IBM


13.3.4 Setting the context root for Web modules

The context root is the part of the URL that comes after the protocol and address but before the path to servlets, JSPs, and so on. In a URL such as http://www.plantsbywebsphere.com/PlantsByWebSphere/servlet/ShoppingServlet, the context root is PlantsByWebSphere. It is used to separate Web modules from each other so that the Web container can dispatch Web requests to the right Web module.

When we created the PlantsByWebSphereWeb module, the Application Server Toolkit assigned it a context root with the same path, PlantsByWebSphereWeb. Because the sample application shipped and installed with WebSphere (if you install the samples) uses a context root of PlantsByWebSphere, we will change the context root also for our module to match.

1. Expand the Dynamic Web Projects section. Right-click the PlantsByWebSphereWeb module and select Properties.

2. Select the J2EE tab.

3. Change the context root to PlantsByWebSphere, as shown in Figure 13-15.

Figure 13-15 Setting context root for Web module

Click OK.


Redbooks ibm.com/redbooks

Next