• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sybex: Context attribute thread safety

 
Ram Manglampalli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page:287
So in summary, we can say context attributes are fairly thread safe, because they are usually defined in web.xml file and most servers do synchronize the setAttribute(...) method.

Context attributes are defined in web.xml??? give me a break...besides being incorrect, I have never seen such a vague statement. So what is the answer, are they thread safe or not??? Should I assume that they are thread safe? or there is no such guarantee???
Can anybody please tell me what's the deal with the context attributes?
 
Ram Manglampalli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the previous listing, the author has given a web.xml snippet showing some <context-param>s:
<context-param>
<param-name>databaseProtocol</param>
<param-value>jdbc: ...</param-value>
</context-param>
and a servlet code accessing it using context.getAttribute("databaseProtocol");
And all this is for the section which is supposed to teach me whether context ATTRIBUTES (not context parameters) are thread safe or not. What the hell is going on??? However calls this a typo is insane. The author has no idea what he/she is talking about.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic