File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Thread Safe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Thread Safe" Watch "Thread Safe" New topic

Thread Safe

Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
Following are thread Safe
request attributes
response Object
local variables

Following are not thread Safe
servletcontext attributes
session attributes
instance variables

What about ServletConfig parameters?
Are they access by multiple threads at a single time?
i know ServletConfig parameters are Read Only constants.

Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
ServletConfig Parameters are readonly then i think it doesn't matter
Elan Ram
Ranch Hand

Joined: Dec 14, 2006
Posts: 40
Hey, we can set only the attributes. Not parameters. There are no setter methods to set the same.
Hence, Thread safety is applied only to attributes and not a paramters.

Thanks and regards,
Manikandan Jayaraman
Ranch Hand

Joined: Sep 15, 2004
Posts: 230
More to note ...

As said, Parameters are thread-safe as there are no setters for the same.

Only in SingleThreadModel, instance variables are thread-safe.

Static Variables, Context Attributes and Session Attributes are never thread safe.

Regards,<br />Mani<br />SCJP 1.4 (95%)<br />SCWCD 1.4 (94%)
I agree. Here's the link:
subject: Thread Safe
It's not a secret anymore!