Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between getServletContext().setAttribute() and public data members in servlet class?

 
Gautam Bhalla
Ranch Hand
Posts: 30
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is difference between getServletContext().setAttribute() and public data members in servlet classes?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The difference is the scope in which these variables are visible.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And that public data members in the servlets will cause no end of threading issues and problems.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic