且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Servlet中访问会话范围内的JSF托管Bean,是否保证该会话与JSF使用的会话相同?

更新时间:2022-06-24 06:41:57

如果两者都部署在同一服务器和上下文中,那么,是的,JSF肯定使用与Servlet完全相同的HTTP会话.作为基于Servlet的MVC框架,JSF只是在标准Servlet API之上运行,并将托管bean作为会话属性存储,而托管bean名称作为键.

If both are deployed on the same server and context, then, yes, JSF definitely uses the very same HTTP session as the servlet. JSF as being a servlet based MVC framework just runs on top of the standard servlet API and stores managed beans as session attributes with the managed bean name as key.

  • Get JSF managed bean by name in any Servlet related class
  • How do servlets work? Instantiation, sessions, shared variables and multithreading