ProAnswers.org

How to get the context parameters and servlet init parameters?

To get the context param: ServletContext application = getServletConfig().getServletContext(); String xxx = application.getInitParameter(“xxx”); To get the servlet init parameter: Enumeration enumeration = getServletConfig().getInitParameterNames(); while(enumeration.hasMoreElements()){ pw.print(enumeration.nextElement() + " "); }