Declaring the Bean class in the faces-config.xml file

This example illustrates how to define the bean in the faces-config.xml file with element. Its child element can be used to provide name for the bean. This name can be referred through out the application to access the bean. Its original class name is specified in another child element . child element is used to specify the property value, specifies the property name and specifies its value.



The source code of the faces-config.xml file is as follows:





xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">

SimpleLogin
class>roseindia.SimpleLoginclass>
request


/login.jsp
case>
#{LoginForm.CheckValidUser}
success
/success.jsp
case>
case>
#{LoginForm.CheckValidUser}
fail
/fail.jsp
case>



Download Source Code

0 comments:

Post a Comment