File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Scopes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Scopes" Watch "Scopes" New topic
Author

Scopes

Jesus Schneider
Greenhorn

Joined: Oct 17, 2012
Posts: 28
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: 16012
    
  19

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://aspose.com/file-tools
 
subject: Scopes