Advertisement
andersonalmada

Untitled

Jun 27th, 2022
936
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package br.ufc.mandacarau;
  2.  
  3. import jakarta.servlet.ServletContextEvent;
  4. import jakarta.servlet.ServletContextListener;
  5. import jakarta.servlet.ServletRequestEvent;
  6. import jakarta.servlet.ServletRequestListener;
  7. import jakarta.servlet.http.HttpSessionEvent;
  8. import jakarta.servlet.http.HttpSessionListener;
  9.  
  10. /**
  11.  * Application Lifecycle Listener implementation class HelloListener
  12.  *
  13.  */
  14. public class HelloListener implements ServletContextListener, HttpSessionListener, ServletRequestListener {
  15.  
  16.     /**
  17.      * Default constructor.
  18.      */
  19.     public HelloListener() {
  20.         // TODO Auto-generated constructor stub
  21.     }
  22.  
  23.     /**
  24.      * @see HttpSessionListener#sessionCreated(HttpSessionEvent)
  25.      */
  26.     public void sessionCreated(HttpSessionEvent se)  {
  27.          System.out.println("sessionCreated");
  28.     }
  29.  
  30.     /**
  31.      * @see HttpSessionListener#sessionDestroyed(HttpSessionEvent)
  32.      */
  33.     public void sessionDestroyed(HttpSessionEvent se)  {
  34.         System.out.println("sessionDestroyed");
  35.     }
  36.  
  37.     /**
  38.      * @see ServletContextListener#contextInitialized(ServletContextEvent)
  39.      */
  40.     public void contextInitialized(ServletContextEvent sce)  {
  41.         System.out.println("contextInitialized");
  42.     }
  43.  
  44.     /**
  45.      * @see ServletContextListener#contextDestroyed(ServletContextEvent)
  46.      */
  47.     public void contextDestroyed(ServletContextEvent sce)  {
  48.         System.out.println("contextDestroyed");
  49.     }
  50.  
  51.     /**
  52.      * @see ServletRequestListener#requestInitialized(ServletRequestEvent)
  53.      */
  54.     public void requestInitialized(ServletRequestEvent sre)  {
  55.         System.out.println("requestInitialized");
  56.     }
  57.  
  58.     /**
  59.      * @see ServletRequestListener#requestDestroyed(ServletRequestEvent)
  60.      */
  61.     public void requestDestroyed(ServletRequestEvent sre)  {
  62.         System.out.println("requestDestroyed");
  63.     }
  64.    
  65. }
  66.  
Advertisement
RAW Paste Data Copied
Advertisement