request,response,out这些是线程安全的,只跟一个请求线程相关;
pageContext也只跟一个请求线程相关,pageContext itself is thread safe, but not if you set session or application attributes with it;
config是一个jsp页面一个,config is shared between calls to the JSP but there's no method in the ServletConfig class which might create problems,所以config也可以认为是线程安全的。
page指的是这个jsp的servlet instance,一个jsp页面一个,由于其可能存在instance variable等,所以不线程安全;
session不线程安全,每个session一个;
application也不线程安全,整个application一个。
pageContext也只跟一个请求线程相关,pageContext itself is thread safe, but not if you set session or application attributes with it;
config是一个jsp页面一个,config is shared between calls to the JSP but there's no method in the ServletConfig class which might create problems,所以config也可以认为是线程安全的。
page指的是这个jsp的servlet instance,一个jsp页面一个,由于其可能存在instance variable等,所以不线程安全;
session不线程安全,每个session一个;
application也不线程安全,整个application一个。
本文探讨了request、response、out、pageContext、config等组件在线程环境下的安全性,并指出了哪些组件是线程安全的,哪些不是。对于不安全的组件如page、session和application,特别强调了它们可能存在的风险。
9951

被折叠的 条评论
为什么被折叠?



