81,094
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<listener>
<listener-class>com.MyServletContextListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
package com;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
* 初始化加载
* @author xuhe
*
*/
public class MyServletContextListener implements ServletContextListener {
public void contextInitialized(ServletContextEvent arg0) {
System.out.println("初始化加载");
}
public void contextDestroyed(ServletContextEvent sce) {
}
}