Class ServletInitializer


  • public abstract class ServletInitializer
    extends java.lang.Object
    Encapsulates all initialization and configuration needed by the OpenNMS servlets and JSPs.
    Author:
    Lawrence Karnowski , OpenNMS
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void init​(javax.servlet.ServletContext context)
      Initialize servlet and JSP configuration on the first invocation of this method.
      • Methods inherited from class java.lang.Object

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

      • init

        public static void init​(javax.servlet.ServletContext context)
                         throws javax.servlet.ServletException
        Initialize servlet and JSP configuration on the first invocation of this method. All other invocations are ignored. This method is synchronized to ensure only the first invocation performs the initialization.

        Call this method in the init method of your servlet or JSP. It will read the servlet initialization parameters from the ServletConfig and ServletContext and OpenNMS configuration files.

        Parameters:
        context - the ServletContext instance in which your servlet is running
        Throws:
        javax.servlet.ServletException - if any.