2.1.8. Create and Register Referenced Beans

Creation of Referenced Beans is similar to creation of Custom Validator.

  • In the Project Explorer view open faces-config.xml and select Tree tab.

Referenced Beans in Faces Config Editor

Figure 2.55. Referenced Beans in Faces Config Editor


  • Select Referenced Beans and click on Add button.

  • Type in the name of your Referenced Bean and type in or select Referenced-Bean-Class by using Browse button.

Add Referenced Bean

Figure 2.56. Add Referenced Bean


  • In the Referenced Bean section you should see your Referenced-Bean-Name and Referenced-Bean-Class. Click on the link to open the Java creation wizard.

Create Referenced Bean Class

Figure 2.57. Create Referenced Bean Class


  • Java class will be created automatically. Leave everything without changes and click Finish.

New Java Class Form

Figure 2.58. New Java Class Form


  • To open Referenced Bean class click again on Referenced-Bean-Class in the Referenced Bean section. Now you are able to write business logic of Referenced Bean in the Java editor.

Referenced Bean Class Editing

Figure 2.59. Referenced Bean Class Editing