aspose file tools
The moose likes Servlets and the fly likes JavaBean Thread Safety? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "JavaBean Thread Safety?" Watch "JavaBean Thread Safety?" New topic
Author

JavaBean Thread Safety?

Andreas Sandberg
Ranch Hand

Joined: Sep 14, 2005
Posts: 31
Hi Guys,

I currently have an application I'm working on where users add work log entries through a standard form. They can add multiple entries and then click save which adds the entries to a database. While they are adding new entries they can view all their old entries and delete or update any of them. I'm currently storing all of these entries through a servlet in a vector and adding them to a particular user through the session API, but I'm wondering if I shouldn't do this through a bean method? I currently have a bean setup which validates all of the entries. If the validation is true I then pass the request to a servlet which stores the entries in a vector. Should I transfer this control to a bean? If I do, how can I ensure that each user logged into the system gets their own bean and that other users aren't accessing other peoples bean's? I set the scope of the bean to a session scope so I'd imagine that the bean will remain with that particular user but I just want to be on the safe side! Thanks so much.

Andreas


"When the compilers not happy ain't nobody happy"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56202
    
  13

Yes, scoped variables stored in the session are not accessible by other users.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaBean Thread Safety?
 
Similar Threads
What is a session
Adding objects to session
Targetting specific Objects in session
Servlet Design Question
Inspiration and help needed