摘要: 跟HttpSessionListener有些相似,需要在Web.xml中配置,都是在服务器启动的时候实例化。 ServletContextListener的销毁 是在服务器关闭的时候。 两个方法———————————— 初始化 public void contextInitialized(Servl 阅读全文
posted @ 2017-08-17 15:22 盛夏光年2017 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 类实现HttpSessionListener接口 重写这两个方法———————————— 创建时机:当用户访问项目的时候 public void sessionCreated(HttpSessionEvent event){ //从作用域中取值 Integer num=(Integer) event 阅读全文
posted @ 2017-08-17 14:58 盛夏光年2017 阅读(148) 评论(0) 推荐(0) 编辑