1

I am trying to identify when a servlet is initilazed (not the init() method called), when container try to load an individual servlet ? Or, any mechanism which keeps track of servlet initialized / destroyed / pending to load.

I am aware of the ServletContextListner, which invoked on application start & shutdown. But, I am looking for kind of listener, which probably trigger on individual servlet load / destroy event.

So, scenario would be like : /Servlet1 /Servlet2 An listener which trigger on servlet1 load and then for Servlet2.

saurabh208
  • 11
  • 3

1 Answers1

0

I guess this is the listener you are looking for .You want to know each time a request comes in, so that you can log it. javax.servlet.ServletRequestListener . Following are the methods requestInitialized requestDestroyed

Avinash Reddy
  • 2,204
  • 3
  • 25
  • 44
  • Thanks for your reply. But, i am not looking to log each request. I am interested in identifying the when servlet is loaded by server – saurabh208 Mar 30 '17 at 09:30