Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scopes

 
Jesus Schneider
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic