阅读背景:

WebApp中的静态ThreadLocal变量——是否存在安全/性能问题?

来源:互联网 

I am researching and experimenting with a ThreadLocal variable in my Java Web Application. I am using the ThreadLocal variable to store a username (collected from the session) before a request, and then removing it after the request. I have done this by calling a static utility method in a ServletFilter. The reason I do not simply retrieve the username from the session is because I have inherited a system with long-running processes that sometimes take longer to run than the session timeout would allow. My idea is to grab the username before the request is processed and store it in a ThreadLocal variable, thus giving me access to the username throughout the duration of the request even if it takes longer than 15 minutes.I am researching and experimenting with a Threa




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: