1、写一个类实现servletcontextlister接口(对应application),web项目启动时创建
重新创建,销毁方法,自定义的方法写在创建方法内
2、web.xml文件内注册监听listener