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:
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial
Ask Questions? Discuss: Declaring the Bean class in the faces-config.xml file
Post your Comment