public interface Servlet {
void init(ServletConfig var1) throws ServletException;
ServletConfig getServletConfig();
void service(ServletRequest var1, ServletResponse var2) throws ServletException, IOException;
String getServletInfo();
void destroy();
}
<servlet>
<servlet-name>Xxx</servlet-name>
<servlet-class>com.lingz.Xxx</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Xxx</servlet-name>
<servlet-class>com.lingz.Xxx</servlet-class>
<!--两个自定义的初始化参数-->
<init-param>
<param-name>value1</param-name>
<param-value>key1</param-value>
</init-param>
<init-param>
<param-name>value2</param-name>
<param-value>key2</param-value>
</init-param>
</servlet>
public interface ServletConfig {
String getServletName();
ServletContext getServletContext();
String getInitParameter(String var1);
Enumeration<String> getInitParameterNames();
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |