当前位置: 代码迷 >> JavaScript >> 在 JSF 的 Managed Bean 中取得request session对象
  详细解决方案

在 JSF 的 Managed Bean 中取得request session对象

热度:372   发布时间:2012-11-10 10:48:51.0
在 JSF 的 Managed Bean 中获得request session对象
request:
------------------------------------
FacesContext context = FacesContext.getCurrentInstance();
ExternalContext ec = context.getExternalContext();
HttpServletRequest request = (HttpServletRequest) ec.getRequest();


session:
------------------------------------
FacesContext context = FacesContext.getCurrentInstance();
ExternalContext ec = context.getExternalContext();
HttpSession session = (HttpSession) ec.getSession(true);


http://stenlylee.iteye.com/blog/317186
  相关解决方案