By: Ivan Lim Emailed: 1748 times Printed: 2432 times
• None: Objects with this scope are not visible in any JSF page. When used in the configuration file, they indicate managed beans that are used by other managed beans in the application. Objects with none scope can use other objects with none scope.
• Request: Objects with this scope are visible from the start of the request until the end
of the request. Request scope starts at the beginning of a request and ends when the
response has been sent to the client. If the request is forwarded, the objects are visible
in the forwarded page, because that page is still part of the same request/response
cycle. Objects with request scope can use other objects with none, request, session,
or application scope.
• Session: An object with session scope is visible for any request/response cycle that
belongs to a session. Objects with this scope have their state persisted between
requests and last until the object or the session is invalidated. Objects with session
scope can use other objects with none, session, or application scope.
• Application: An object with application scope is visible in all request/response cycles
for all clients using the application, for as long as the application is active. Objects with
application scope can use other objects with none or application scope.
You may know that when you use the <useBean> standard action, you can specify similar scopes for the JavaBean. The difference is that JSP scope includes an additional scope named page. Because JSF requests often involve navigation between pages, objects with page scope have no value in a JSF application.
Most often, you will define your managed beans to have session scope. However, in some cases, you may have a managed bean that encapsulates global data. For example, you may have a managed bean that holds information common to every page in the application; in that case, you would define the managed bean to have application scope. Managed beans that you use only within a single request/response will have request scope.
View Tutorial By: Mustafa at 2010-05-16 10:12:33
View Tutorial By: Ebi Divakar at 2011-07-26 04:31:30
View Tutorial By: Ahmed at 2011-12-04 10:01:11
View Tutorial By: jsf noob at 2012-02-02 13:24:12
View Tutorial By: Awo at 2012-02-11 12:17:36
View Tutorial By: abdelaziz akharraz at 2012-10-09 15:06:52
Most Viewed Articles (in JSF )
Most Emailed Articles (in JSF)