tomcat启动时自动启动程序

xiaoxiao2021-02-28  85

代码:

public class test  implements ServletContextListener{ public void contextInitialized(ServletContextEvent sce) { } public void contextDestroyed(ServletContextEvent sce) { } }

实现接口ServletContextListener

在web.xml中配置

  <listener>    <listener-class>org.cai.MyListener</listener-class>   </listener>

转载请注明原文地址: https://www.6miu.com/read-69372.html

最新回复(0)