Many methods of my Servlet use HTTPSession. It is thread-safety to declare HTTPSession variable as instance variable? 解决方案 By defaut Servlets are not thread safe. And moreover, a servlets instance will invoked for many clients. It is absolutely wrong to have session as instance variable.Reference:Is a Servlet thread-safeWrite thread safe servlets 这篇关于使用会话作为实例变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-21 11:11