wood burning stoves 2.0*
The moose likes JSP and the fly likes difference between  getServletContext().setAttribute() and public data members in servlet class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "difference between  getServletContext().setAttribute() and public data members in servlet class?" Watch "difference between  getServletContext().setAttribute() and public data members in servlet class?" New topic
Author

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

Gautam Bhalla
Ranch Hand

Joined: Mar 31, 2013
Posts: 30

What is difference between getServletContext().setAttribute() and public data members in servlet classes?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12786
    
    5
The difference is the scope in which these variables are visible.

Bill
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61218
    
  66

And that public data members in the servlets will cause no end of threading issues and problems.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between getServletContext().setAttribute() and public data members in servlet class?