如何跟踪会话创建 [英] How to trace session creation

查看:49
本文介绍了如何跟踪会话创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我有一个使用 Spring 框架制作并部署在 apache、tomcat 上的应用程序我在 tomcat manager 上看到应用程序中有许多未使用的会话我想跟踪创建此会话的时间以及创建它们的人,如何操作?

greetings all i have an application which are made with Spring framework and deployed on apache,tomcat and i see on tomcat manager that there are many un-used sessions in the application and i want to trace when this session are created and who is creating them, how to do so ?

推荐答案

制作一个 HttpSessionListener,在 web.xml 中注册(或使用注解,如果使用 servlet 3.0).

Make a HttpSessionListener, register it in web.xml (or with annotations, if using servlet 3.0).

每当创建会话时都会触发 sessionCreated(..) 方法.

the sessionCreated(..) method is triggered whenever a session is created.

这篇关于如何跟踪会话创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆