Class ServletContextListenerUtil

java.lang.Object
org.joinfaces.servlet.ServletContextListenerUtil

public final class ServletContextListenerUtil extends Object
Helper class for Servlet Context Listeners.

The main feature of this class is the way it registers listeners. They will be treated as if they were declared in a non-programatic way and therefore aren't affected by the restrictions of Section 4.4 of the Servlet Specification.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    This Configuration adds listeners to the servlet-context in a non-programmatic way, so they aren't affected by the restrictions for programmatically registered listeners of Section 4.4 of the Servlet Specification.
    static class 
    This TomcatContextCustomizer adds listeners to the servlet-context in a non-programmatic way, so they aren't affected by the restrictions for programmatically registered listeners of Section 4.4 of the Servlet Specification.
    static class 
    This UndertowDeploymentInfoCustomizer adds listeners to the servlet-context in a non-programmatic way, so they aren't affected by the restrictions for programmatically registered listeners of Section 4.4 of the Servlet Specification.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addListeners(org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory factory, Collection<Class<? extends EventListener>> listeners)
    Adds the given listener classes to the given Web server.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • addListeners

      public static void addListeners(org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory factory, Collection<Class<? extends EventListener>> listeners)
      Adds the given listener classes to the given Web server.
      Parameters:
      factory - The factory for the WebServer to add the listeners to.
      listeners - The listeners to add.