Modifying the web.xml file – HP Integrity NonStop J-Series User Manual
Page 47

<body>
<h2 align="center">Welcome to the EmpInfo Application</h2>
<br>
<p>This is EmpInfo Test Page.</p>
</body>
</html>
The code of the EmpInfo application developed so far is located in <My SASH
Home>\spring\getting-started\EmpInfo-InParts\Part-1
.
At this point, you can either deploy and verify the EmpInfo application you have developed so far
on the NonStop system, or you can proceed with the steps for modifying the web.xml file.
For deployment, see the steps described in
“Deploying EmpInfo on NonStop” (page 87)
You can verify the EmpInfo application by accessing the following URL:
Modifying the web.xml File
To modify the web.xml file, set the dispatcher servlet and its mapping as follows:
1.
Open the EmpInfo/WebContent/WEB-INF/web.xml file by double-clicking it in the Project
Explorer frame.
NOTE:
By default, XML files open in the XML Editor. The XML Editor has two views: Design
and Source view. Select the Source view.
The template for the default web.xml file generated during project creation is:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>
EmpInfo</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
2.
Except index.jsp, delete the other files from <welcome-file-list>.
3.
Set the class for the DispatcherServlet as shown:
<servlet>
<servlet-name>EmpInfo</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
4.
Specify the URL pattern as *.htm in the <servlet-mapping> tag as shown below:
Getting Started with Spring
47