Posted on 2007-12-25 22:56
60 阅读(553)
评论(0) 编辑 收藏 所属分类:
JAVA笔记
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);
------------------------------------------------------------------------
获得session后,便可以利用session来获得一些其它有用的东东了。比如:
session.getServletContext().getRealPath("/"); // 磁盘路径