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 request atributes are always 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 "request atributes are always thread-safe?" Watch "request atributes are always thread-safe?" New topic

request atributes are always thread-safe?

Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
a question,

are the request "attributes" even thread-safe always?


SCJP | SCWCD | SCBCD | SCWSD 5 | SCEA (I) 1.4 | SCEA 5 | IBM SOA 669
Vivek Kinra
Ranch Hand

Joined: Mar 11, 2006
Posts: 66

Request attribute are always thread safe but session and context are not.
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 951

I think, therotically correct but not practically. Think if you have referenec to request attribute object and updating some properties throug this reference in another thread.


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Aleksander Zielinski
Ranch Hand

Joined: Nov 11, 2005
Posts: 127
Check this thread:

Anyway, I did a small test:

In result.jsp dog's name is "NEW NAME", so it looks like they are thread safe, even though we still have the reference in One to the request object we can't set new value for this attribute's property "name".
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
HI Aleksander ,

btw, nice thread.

but for the exam...should we say that "request attributes" are thread-safe, aren�t we?


Ganesh.P Ram
Ranch Hand

Joined: Dec 22, 2005
Posts: 41
Request attributes and local variables in service methdos are thread safe.

I agree. Here's the link:
subject: request atributes are always thread-safe?
It's not a secret anymore!