Hello everybody :) I am implementing a dropdown autocomplete. This is my code so far:
The DataHelper actually is used for reading values from the database. The Thanks :) asked 22.12.2016 at 08:53 tano9321 |
A managed bean has always a scope and the scope defines how long a bean lives. The default scope is request. Means the bean gets created for each request at most once. So when the same bean is used multiple times in the same request, always the same beans instance is used. Therefore the method JSF 2.x supports the below scopes. Your choice will probably be
Session Scope: The session scope persists from the time that a session is established until session termination. A session terminates if the web application invokes the invalidate method on the HttpSession object, or if it times out. RequestScope: The request scope is short-lived. It starts when an HTTP request is submitted and ends after the response is sent back to the client. If you place a managed bean into request scope, a new instance is created with each request. It is worth considering request scope if you are concerned about the cost of session scope storage. ApplicationScope: The application scope persists for the entire duration of the web application. That scope is shared among all requests and all sessions. You place managed beans into the application scope if a single bean should be shared among all instances of a web application. The bean is constructed when it is first requested by any user of the application, and it stays alive until the web application is removed from the application server. ViewScope: View scope was added in JSF 2.0. A bean in view scope persists while the same JSF page is redisplayed. (The JSF specification uses the term view for a JSF page.) As soon as the user navigates to a different page, the bean goes out of scope. Source: Core Java Server Faces 3rd Edition by David Geary & Cay Horstmann [Page no. 51 - 54]): answered 22.12.2016 at 09:56 Flavio Sadeghi ♦♦ thank you, that was the information I need :)
(22.12.2016 at 11:22)
tano9321
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 22.12.2016 at 08:53
Seen: 2,865 times
Last updated: 22.12.2016 at 11:22