转自http://community.csdn.net/Expert/topic/5566/5566561.xml?temp=3.553408E-02
FacesContext.getCurrentInstance().getExternalContext().getRequestServletPath();
FacesContext.getCurrentInstance().getExternalContext().getRequestPathInfo();
FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();