209 Java Web application with HttpSessionListener, ServletContextListener, ServletRequestListener

preview_player
Показать описание
Java Web application to demonstrate / apply all 3 listeners ( HttpSessionListener, ServletContextListener, ServletRequestListener ) on 61HttpSessionWithCookiesApp2 (Tutorial No.196):
Operations:
1) To keep track of each request processing duration/time.
2) To keep track of each clients session duration/time.
3) To keep track of the deployment & undeployment timings of web application.

Step 1) Keep 61HttpSessionWithCookiesApp2 web application ready in Server of Previous Tutorial No. 196

Create table:
create table info(name varchar(20), addr varchar(40), age varchar(2),
exp varchar(2), skills varchar(20), city varchar(20), salary varchar(10));
63ServletListenersApp1: (DDS)
----------------------
|--------WEB-INF
|--------classes
|
|---------lib

Add the *.jar (Mysql)

Step 2) Develop 3 user-defined Listener class under WEB-INF/classes directory of 63ServletListenersApp1 web application.

Test Web Application:
---------------------

Do observe session id for different browsers

Observe tomcat server console messages

INFO: /furl has taken 8 Milliseconds to processs a request
INFO: /surl has taken 4 Milliseconds to processs a request
INFO: /turl has taken 804 Milliseconds to processs a request

INFO: /63ServletListenersApp1 webapplication is in running mode for 172438 Milliseconds

Do observe the output.

INFO: /furl has taken 12 Milliseconds to processs a request

INFO: /surl has taken 15 Milliseconds to processs a request

INFO: /turl has taken 754 Milliseconds to processs a request

INFO: /63ServletListenersApp1 webapplication is undeployed/reloaded/stopped at Thu Apr 30 13:26:12 IST 2020

INFO: /63ServletListenersApp1 webapplication is in running mode for 316464 Milliseconds

INFO: /63ServletListenersApp1 webapplication id depolyed/restarted/reloaded at Thu Apr 30 13:26:12 IST 2020
Рекомендации по теме
Комментарии
Автор

Its better u come back after doing all the documentation work...Thought of watching an example program for servlet listener....But my bad I'm watching how u r keeping track of ur tutorials/files/names and all

nandinalakshmi