Interface ServletContextEventSource


public interface ServletContextEventSource
This event context is used to register listeners for various servlet context events. These events will be triggered by the servlet engine as appropriate during servlet processing. An implementation of this event context is available to all servlets as a ServletContext attribute by using the ServletContext.getAttribute() method.

Sample Usage (from within a servlet):

 ServletContextEventSource sces = (ServletContextEventSource)getServletContext().getAttribute(
                                 ServletContextEventSource.ATTRIBUTE_NAME);
 sces.addServletErrorListener(myErrorListener);
 
  • Field Details

    • ATTRIBUTE_NAME

      static final String ATTRIBUTE_NAME
      The ServletContext attribute name that the servlet context event source can be retrieved using.
      See Also:
  • Method Details

    • addApplicationListener

      void addApplicationListener(ApplicationListener al)
      Register a listener for application events.
    • removeApplicationListener

      void removeApplicationListener(ApplicationListener al)
      Deregister a listener for application events.
    • addServletInvocationListener

      void addServletInvocationListener(ServletInvocationListener sil)
      Register a listener for servlet invocation events.
    • removeServletInvocationListener

      void removeServletInvocationListener(ServletInvocationListener sil)
      Deregister a listener for servlet invocation events.
    • addServletErrorListener

      void addServletErrorListener(ServletErrorListener sel)
      Register a listener for servlet error events.
    • removeServletErrorListener

      void removeServletErrorListener(ServletErrorListener sel)
      Deregister a listener for servlet error events.
    • addServletListener

      void addServletListener(ServletListener sl)
      Register a listener for servlet events.
    • removeServletListener

      void removeServletListener(ServletListener sl)
      Deregister a listener for servlet events.
    • addFilterInvocationListener

      void addFilterInvocationListener(FilterInvocationListener fil)
      Register a listener for filter invocation events.
    • removeFilterInvocationListener

      void removeFilterInvocationListener(FilterInvocationListener fil)
      Deregister a listener for filter invocation events.
    • addFilterErrorListener

      void addFilterErrorListener(FilterErrorListener fil)
      Register a listener for filter error events.
    • removeFilterErrorListener

      void removeFilterErrorListener(FilterErrorListener fil)
      Deregister a listener for filter error events.
    • addFilterListener

      void addFilterListener(FilterListener fil)
      Register a listener for filter events.
    • removeFilterListener

      void removeFilterListener(FilterListener fil)
      Deregister a listener for filter events.