Modifying the index.jsp file, Creating the faces-config.xml file – HP Integrity NonStop J-Series User Manual

Page 441

Advertising
background image

.style1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 16px;
color: green;
font-weight:bold;
}
.style2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
}
.style3 {font-size: 13px; font-family: Verdana, Arial, Helvetica, sans-serif;}
.style4 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
color: #FF0000;
}
.errors {
font-style: italic;
color: green;
}

Modifying the index.jsp File

Modify EmpInfo/index.jsp by removing the existing code and adding the redirect tag to the
faces-enabled page welcome.jsp, as shown below:

<% response.sendRedirect("pages/welcome.jsf"); %>

Creating the faces-config.xml File

This file contains configuration details for the MyFaces implementation.

To create the faces-config.xml file, complete the following steps

1.

Create the faces-config.xml file in the EmpInfo/WebContent/WEB-INF directory as
explained in the

Creating the EmpInfo-servlet.xml File

section in the

Getting Started

with Spring

chapter.

2.

Modify the faces-config.xml file to include information about message bundle, backing
bean, and navigation rules.

After modification, the faces-config.xml file must appear as shown:

<?xml version="1.0"?>

<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd" >

<faces-config>

<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<message-bundle>com.hp.empinfo.web.message</message-bundle>
</application>
<managed-bean>
<managed-bean-name>EmpBean</managed-bean-name>
<managed-bean-class>
com.hp.empinfo.web.EmpBean
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>

Example of Integrating MyFaces into Spring 441

Advertising
This manual is related to the following products: