CodesJava

Easy learning with example program codes

jsf bean scopes


Bean Scopes:

When we define a bean, we have to define its scope also in which it will be placed. JSF implementation provide us several scope for a bean. Request scope is the default scope.

Commonly used bean scopes:

1. Request scope.
2. View scope.
3. Session scope.
4. Application scope.

Request scope:

In request scope bean created when a request involving this bean comes and destroyed after completing response.

View scope:

In view scope bean created when a request involving this bean comes and destroyed when view changed.

Session Scope:

In session scope bean created when first request involving this bean comes and destroyed when session is terminated.

Application scope:

In application scope bean created when first request involving this bean comes and remains lives for whole duration of web application. An application scope managed bean is shared in all requests and sessions.
 

Sign Up/ Sign In
Ask a Question


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 © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki