转:web程序的初始化问题——ServletContextListener----调试成功
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
??? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
??? xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
??? version="2.4">
??? <description>
????? test servlet listener
??? </description>
??? <display-name>testServletListener</display-name>
?<listener>
??<listener-class>com.chuyang.Test
?? </listener-class>
</listener>
?
</web-app>
Test.java:
package com.chuyang;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;