saurabh208
saurabh208

Reputation: 11

Servlet Initialization Listener

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.

Upvotes: 1

Views: 539

Answers (1)

Avinash Reddy
Avinash Reddy

Reputation: 2290

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

Upvotes: 0

Related Questions