Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
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.

 

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 <managed-bean> element. Its child element <managed-bean-name> 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 <managed-bean-class><managed-property> child element is used to specify the property value, <property-name> specifies the property name and  <value> specifies its value.

 

 

 

 



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

<?xml version='1.0' encoding='UTF-8'?>

<!-- =========== FULL CONFIGURATION FILE ================================== -->

<faces-config version="1.2" 
    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">
    <managed-bean>
            <managed-bean-name>SimpleLogin</managed-bean-name>
            <managed-bean-class>roseindia.SimpleLogin</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
            <from-view-id>/login.jsp</from-view-id>
        <navigation-case>
            <from-action>#{LoginForm.CheckValidUser}</from-action>
            <from-outcome>success</from-outcome>
            <to-view-id>/success.jsp</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-action>#{LoginForm.CheckValidUser}</from-action>
            <from-outcome>fail</from-outcome>
            <to-view-id>/fail.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>
    
</faces-config>


Download Source Code

                          

» View all related tutorials
Related Tags: java flex programming ide development netbeans language sed environment vi quality range int id beans gem program lex ram base

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.