File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes ServletContext attributes and threading issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletContext attributes and threading issues" Watch "ServletContext attributes and threading issues" New topic

ServletContext attributes and threading issues

Krzysiek Hycnar
Ranch Hand

Joined: Jan 02, 2004
Posts: 74
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

I agree. Here's the link:
subject: ServletContext attributes and threading issues
It's not a secret anymore!