<!-- 测试监听,listener-class值为监听的路径 -->
<listener>
<listener-class>com.test.listener.Jurisdictionlistener</listener-class>
</listener>
启动就有用啦
package com.test.listener;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class Jurisdictionlistener implements ServletContextListener {
@Override
public void contextDestroyed(ServletContextEvent arg0) {
}
/**
* 测试
*/
@Override
public void contextInitialized(ServletContextEvent arg0) {
System.out.println("1111111111111111111111111");
}
}
<listener>
<listener-class>com.test.listener.Jurisdictionlistener</listener-class>
</listener>
启动就有用啦
package com.test.listener;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class Jurisdictionlistener implements ServletContextListener {
@Override
public void contextDestroyed(ServletContextEvent arg0) {
}
/**
* 测试
*/
@Override
public void contextInitialized(ServletContextEvent arg0) {
System.out.println("1111111111111111111111111");
}
}