Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContext attributes and threading issues

 
Krzysiek Hycnar
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I've got a question (possibly a lame one). Servlet context attributes in my app are set ONLY ONCE and that happens on the application startup. The question is if I can safely call ServletContext.getAttribute method without synchronizing it on the ServletContext object?? My guess is yes, but... it's just a guess

Regards
Chris
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic