JSF实现文件的下载功能publicstaticvoiddownloadFile(Stringpath,StringfileName){try{//获得JSF上下文环境FacesContextcontext=FacesContext.getCurrentInstance();//获得ServletContext对象ServletContextservletContext=(ServletContext)context.getExternalContext().getContext();//取得