package web;
import org.springframework.stereotype.Component;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
@Component
public class testServlet implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
// ServletContext servletContext = sce.getServletContext();
//ApplicationContext app = WebApplicationContextUtils.getWebApplicationContext(servletContext);
System.out.println("spring容器创建"); //写这种有什么意义
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
System.out.println("spring容器已销毁");
}
}
|
|