Class CacheSessionListener

  • All Implemented Interfaces:
    jakarta.servlet.http.HttpSessionListener, EventListener

    public class CacheSessionListener
    extends Object
    implements jakarta.servlet.http.HttpSessionListener
    HttpSessionListener which creates a cache for JSP tag body invocations and adds it as a session attribute in response to sessionCreated events, and clears the cache in response to sessionDestroyed events.
    • Constructor Detail

      • CacheSessionListener

        public CacheSessionListener()
        No-arg constructor
    • Method Detail

      • sessionCreated

        public void sessionCreated​(jakarta.servlet.http.HttpSessionEvent hse)
        Receives notification that a session was created, and adds newly created cache for JSP tag body invocations as a session attribute.
        Specified by:
        sessionCreated in interface jakarta.servlet.http.HttpSessionListener
        Parameters:
        hse - the notification event
      • sessionDestroyed

        public void sessionDestroyed​(jakarta.servlet.http.HttpSessionEvent hse)
        Receives notification that a session is about to be invalidated, and clears the session's cache of JSP tag body invocations (if present).
        Specified by:
        sessionDestroyed in interface jakarta.servlet.http.HttpSessionListener
        Parameters:
        hse - the notification event