CodesJava

Easy learning with example program codes

JSF managed and backing bean


JSF managed bean:

A managed bean is a normal java bean class which contains data and business logic. A managed bean is managed by JSF framework and act as a model for JSF application. Before using a managed bean we have to configure it either in faces-config.xml file or using annotation.

JSF backing bean:

JSF backing bean is a managed bean which contains some or all values of a web form. It is normally for business logic.

Configure Managed Bean using faces-config.xml:

Note: We can create a different xml file for managed bean entries and put the entry of this xml file in web.xml under javax.faces.CONFIG_FILES initialize parameter.
<context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>WEB-INF/yourconfig.xml</param-value>
  </context-param>

Configure Managed Bean using annotation:

@ManagedBean annotation is used to mark a bean to be managed bean. Name attribute specify the managed bean name and if not specified then class name is taken as default managed bean name.
 



Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2019 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki