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

servlet's thread safe

David Qiu
Greenhorn

Joined: May 14, 2001
Posts: 8
hi,
i am doing a project which allows more than one person to access a servlet, which results in multiple servlet instances at the same time. and i think some objects may not be in a consistent way, they are servlet class variables, request attributes, session attributes and context attributes. is that right? do i need to synchronized these objects? thanks in advance
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Yes, you can either synchronize any access to those variables, or implement the "SingleThreadModel" interface.
Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet's thread safe
 
Similar Threads
Difference. between ServletContext and Session Attributes
LDAP search returns collection of Attributes objects
request
Question on attributes
someone pls explain me this statement...