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
From the course: Java EE: Servlets and JavaServer Pages (JSP)
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
Understanding the need for filters in a web app8m 19s
-
(Locked)
Filters: User validation in a servlet9m 29s
-
(Locked)
Filters: Display error and set up filter class6m 25s
-
(Locked)
Filters: Implement filter logic10m 15s
-
(Locked)
Understanding the need for listeners in a web app5m 33s
-
(Locked)
Using listeners in a web app10m 51s
-
-
-
-