当前位置: 代码迷 >> Java Web开发 >> jsf中怎么取得当前系统路径
  详细解决方案

jsf中怎么取得当前系统路径

热度:120   发布时间:2016-04-17 14:21:41.0
jsf中如何取得当前系统路径
如何在jsf中取当前系统路径啊
象在Struts中的这样

    String   filePath   =   this.getServlet().getServletContext()
                                        .getRealPath( "/ ");
                        System.out.print( "当前系统路径 "+filePath);

谢谢

------解决方案--------------------
FacesContext.getCurrentInstance().getExternalContext().getRequestServletPath();
FacesContext.getCurrentInstance().getExternalContext().getRequestPathInfo();
FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
你自己随便选吧.
  相关解决方案