web.xml配置:
<servlet> <servlet-name>AServlet</servlet-name> <servlet-class>AServlet</servlet-class> <init-param> <param-name>name</param-name> <param-value>ycy</param-value> </init-param> </servlet>
获取方式:
this.getServletConfig().getInitParameter("name");