The Java Servlet Specification supports application level events for controlling interactions with the ServletContext and HttpSession objects and for managing the resources that a web application uses.
Application event listeners are classes that implement one or more of the servlet event listener interfaces. Application events notify listener objects when servlet contexts and sessions are initialized and destroyed, as well as when attributes are added or removed from a context or session.
The IDE provides a wizard to help you create listener classes. Use the Web Application Listener wizard to create listener classes that manage resources or state held at a virtual machine level for the web application.
You use the listener element to declare listeners in the deployment descriptor (web.xml). List the listener elements in the order in which they are to be invoked.
To create a listener:
For more information about listeners, see the Java Servlet Specification available at
.