Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet loading

 
Monmohan Singh
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to make sure that a servlet is loaded once and only once by the server.?
 
Mani Narayanan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest way to find this, put system out in your servlet initialization method for eg: init(ServletConfig) and when you call the same servlet again, check whether the system out are printed again but it won't since initialize method is called only once for every loading in the servlet container.
stop your servlet container and again start the same it will call the initialize method again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic