在 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

你可能感兴趣的:(bean,JSF,Blog)