To create a managed bean for the Facelets, right-click on WebContent/WEB-INF/faces-config.xml and select Open With | Faces Config Editor, as shown in the following screenshot:
Select the ManagedBean tab. Click on Add to add a managed bean, as follows:
In the New
Managed Bean Wizard dialog box select Create a new Java class and click on Next. Select Facelets/src as Source folder, and catalog.backing as Package. Specify the Java class name as Catalog
in the Name field and click on Next, as shown in the following screenshot:
Specify catalog
as
Managed Bean name, set session as Managed Bean Scope, and click on Next. In Wizard Summarys click on Finish. A managed bean gets added.
In Catalog.java
, which is the Java class for the managed bean, add the required import
statements for the HTML and UI components. Add managed bean properties for the various components used in the application. Add a bean property for an HtmlDataTable
type component for a data table and add bean...