aspose file tools
The moose likes JSF and the fly likes Scopes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Scopes" Watch "Scopes" New topic
Author

Scopes

Jesus Schneider
Greenhorn

Joined: Oct 17, 2012
Posts: 23
Hi!
I'm new with JSF and I have what I think is a very basic question:
Let's say we have a web page made with JSF with a basic login system. That page has a bean with (let's say) application scope to keep the data of that user during his access to that page.
When a user logs inside that page: is an instance of that bean created for each user or that bean is created just once and shared between all users (depending of the scope)?
In other words: Do I need to adapt that bean to manage ALL users data or each user will have it's own bean with just his data?
Thanks!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14460
    
    7

Well, first of all, "basic login" sounds like User-Designed Login, which translates to "Hacked". There is a built-in login system that's part of the J2EE standard that I recommend (rather vocally) over writing your own.

Beyond that, however, "application scope" means that the object is shared between every user in the application. What you are looking for is "session scope", where each user has a separate copy of the object.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Scopes
 
Similar Threads
how to use Spring with LDAP
regarding scope level
Entity Bean and find() method
Problem in setting bean scope to request
Bean confusion!