Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

thread safety ?

 
hasan khan
Ranch Hand
Posts: 223
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a context attribute which is set only in one servlet and accessed in many jsps.
how do i make this attribute thread safe.



i am also looking for some multi-threading tutorial for servlet and jsp
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My suggestion would be to either synchronize on ServletContext or synchronize on the ArrayList stored in the Context and then make changes to the ArrayList.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic