Modifying the web.xml file – HP Integrity NonStop H-Series User Manual
Page 441

Removing the Folders and Files from the EmpInfo Application
Remove the following folders and files from the EmpInfo application:
•
jsp folder in
EmpInfo/WebContent/WEB-INF
.
•
EmpInfo-servlet.xml
file in
EmpInfo/WebContent/WEB-INF
.
•
EmployeeController.java
in
EmpInfo/src/com/hp/empinfo/web
.
Modifying the
web.xml
File
Modify the
web.xml
file to set the Faces servlet and its mapping.
To modify the
web.xml
file, complete the following steps:
1.
Configure
WebApplicationContext
to use the Spring
ContextLoaderServlet
. To do
so, add the following code in the
web.xml
file:
org.springframework.web.context.ContextLoaderServlet
2.
Set the class for the Faces Controller servlet of the EmpInfo application by adding the
following code in the
web.xml
file.
This ensures that the
web.xml
file has a Faces servlet entry
(
javax.faces.webapp.FacesServlet
), which serves as a Faces Controller servlet.
NOTE:
The Faces Controller servlet intercepts all Faces requests.
3.
Specify the URL pattern as
*.jsf
in the
<servlet-mapping/> tag
as shown below:
NOTE:
This servlet mapping definition is for mapping the URL patterns. It ensures that
any URL with the
.jsf
extension is routed to the Faces Servlet (the Faces Controller servlet).
4.
Set the extension filter by adding the following code:
org.apache.myfaces.component.html.util.ExtensionsFilter
Example of Integrating MyFaces into Spring
441