In page 197 of HFSJ, it says that "Synkronizing on the servletContext makes it thread-safe from any other code that also synkronizes on the servletContext". I am kind of confused. Is this a java rule? (i remmember that there is no such rule in plain java)
Thanks for reply. I am not sure if you can synkronize on an attribute of context or not. If you think context as a collection, an attribute (name/value pair) is just like an element of a collection. So the question will be if you can get a lock only on some element of a collection?