Hi, Can i keep track of how many times a servlet is invoked?? If i have todo some initialisation if the servlet is invoked for the first time ,then how can i do it. Thanks, Raju
I do this as sort of a debugger. All you need to do is make a claas attribute called count and in your doGet put count++; count now hold the number of hits.
Hi raju, If you want to do some sort of initialization when servletis invoked for the first time, then you have to override init() or init(ServletConfig) method. If you will override simple init() then you don't need to worry about servletConfig object. If you will override init(ServletConfig) then you have to save that parameter or just call super.init(ServletConfig) by passing the object which you got.