有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JSF2.0中将数据放入会话的不同方法之间的java差异?

在JSF2.0中,有几种方法可以将数据放入会话中 例如:

Making Bean Session Scoped (But I don't consider it a good practice; as I don't need all of the data to be in Session and need just selective info. to be part of a session scope) Using HttpSession object.

Using FacesContext.getCurrentInstance().getExternalContext().getSessionMap.put("key", value)

我在我的测试应用程序中尝试了所有这些方法; 现在,我想知道的是,这些不同方法之间的区别是什么 如果我可以使用HttpSession将数据放入会话中,那么 为什么我们提供了getSessionMap?? 你们有人注意到有什么显著的不同吗


共 (0) 个答案