From the course: Java EE: Servlets and JavaServer Pages (JSP)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using listeners in a web app

Using listeners in a web app

From the course: Java EE: Servlets and JavaServer Pages (JSP)

Start my 1-month free trial

Using listeners in a web app

- [Instructor] So the GEE provides you a lot of listener interfaces that you can create classes out of. Some of them are listed on this slide. You have the ServletContextListener, which is going to be responsible for the deployment and undeployment event software application. So basically, if you write a clause which implements the ServletContextListener, it means that you will be able to capture the events of deployment and undeployment in your application. On the same lines, there is ServletContextAttributeListener. So if you really add or remove or replace attributes in the ServletContextObject, you have this listener to trap those events. HTTPSessionListener is dedicated for the HTTPSessionObject. So when this session gets created or destroyed, that's the point where you can trap those events using this Listener Interface. And as for HTTPSessionAttributeListener, it means if you're trying to add, remove, or replace attributes inside the HTTPSessionObject, then you have this…

Contents