This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Are HttpRequest objects thread safe? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Are HttpRequest objects thread safe?" Watch "Are HttpRequest objects thread safe?" New topic
Author

Are HttpRequest objects thread safe?

Justin Russo
Ranch Hand

Joined: Oct 21, 2007
Posts: 77
Sorry for being impatient here. I already had a question on this and had replied on one of the existing threads but thought that it might get lost!

so adding a new thread.. once again apologies for the repetition

Question:: why is the container synchronizing the Httprequest. This is for servlet generated by tomcat for a JSP.

snippet below copied from tomcat generated servlet

code:


[ June 16, 2008: Message edited by: Justin Russo ]
[ June 16, 2008: Message edited by: Justin Russo ]

You Want it.. Get it.......the Right Way...<br /> <br />SCJP 5.0 SCWCD 5.0
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I guess you are using jsp:useBean. According to the spec, the inspection is done synchronized per scope namespace to avoid non-deterministic behavior. (JSP.5.1 <jsp:useBean> .


[My Blog]
All roads lead to JavaRanch
Justin Russo
Ranch Hand

Joined: Oct 21, 2007
Posts: 77
thanks but what might be that non-deterministic behavior for a particular request?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Are HttpRequest objects thread safe?
 
Similar Threads
which commercial mock exam is better?
constructor question
Regarding Request Parameter Passing
View Refresh after form closed
userBean-beanName attribute problem