Java Servlets
init
parameter values, as in <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app> <servlet> <servlet-name>hi</servlet-name> <servlet-class>HelloWorld</servlet-class> <init-param> <param-name>msg</param-name> <param-value> A can of ASPARAGUS, 73 pigeons, some LIVE ammo, and a FROZEN DAQUIRI!! </param-value> </servlet> </web-app>these can be retrieved with code like
public void init() throws ServletException { //get msg string String msg = getInitParameter("msg"); //Examine all init parameters Enumeration enum = getInitParameterNames(); while (enum.hasMoreElements()){ String name = (String) enum.nextElement();} }
public String ServletConfig.getServletName();
23 of 89