// See also The Quintessential Servlet // This method is called by the servlet container just before this servlet // is put into service. public void init() throws ServletException { getServletContext().log("getinit init"); // Get the value of an initialization parameter String value = getServletConfig().getInitParameter("param1"); // Get all available intialization parameters java.util.Enumeration enum = getServletConfig().getInitParameterNames(); for (; enum.hasMoreElements(); ) { // Get the name of the init parameter String name = (String)enum.nextElement(); // Get the value of the init parameter value = getServletConfig().getInitParameter(name); } // The int parameters can also be retrieved using the servlet context value = getServletContext().getInitParameter("param1"); }