aspose file tools*
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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
Author

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?

tks.


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

Joined: Mar 11, 2006
Posts: 66
Felipe,

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

Joined: Dec 04, 2004
Posts: 950
Hi,

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.


Thanks


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:

http://www.coderanch.com/t/171831/java-Web-Component-SCWCD/certification/request-scope-attributes-thread-safe


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?

Tks.

Ganesh.P Ram
Ranch Hand

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


Ganesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request atributes are always thread-safe?