Class CacheRequestListener

  • All Implemented Interfaces:
    jakarta.servlet.ServletRequestListener, EventListener

    public class CacheRequestListener
    extends Object
    implements jakarta.servlet.ServletRequestListener
    ServletRequestListener which creates a cache for JSP tag body invocations and adds it as a request attribute in response to requestInitialized events, and clears the cache in response to requestDestroyed events.
    • Constructor Detail

      • CacheRequestListener

        public CacheRequestListener()
        No-arg constructor
    • Method Detail

      • requestInitialized

        public void requestInitialized​(jakarta.servlet.ServletRequestEvent sre)
        Receives notification that the request is about to enter the scope of the web application, and adds newly created cache for JSP tag body invocations as a request attribute.
        Specified by:
        requestInitialized in interface jakarta.servlet.ServletRequestListener
        Parameters:
        sre - the notification event
      • requestDestroyed

        public void requestDestroyed​(jakarta.servlet.ServletRequestEvent sre)
        Receives notification that the request is about to go out of scope of the web application, and clears the request's cache of JSP tag body invocations (if present).
        Specified by:
        requestDestroyed in interface jakarta.servlet.ServletRequestListener
        Parameters:
        sre - the notification event