beautypg.com

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

Page 441

background image

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:


context

org.springframework.web.context.ContextLoaderServlet

1

2.

Set the class for the Faces Controller servlet of the EmpInfo application by adding the
following code in the

web.xml

file.


Faces Servlet
javax.faces.webapp.FacesServlet

1

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:


Faces Servlet
*.jsf

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:


extensionsFilter

org.apache.myfaces.component.html.util.ExtensionsFilter


uploadMaxFileSize
100m


uploadThresholdSize
100k

Example of Integrating MyFaces into Spring

441

This manual is related to the following products: