JSF取服务器端绝动路径
方式一:
HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
String rootpatch = session.getServletContext().getRealPath("/");
方式二:
public static String getRealPath(String path)
{
return ((ServletContext) FacesContext.getCurrentInstance()
.getExternalContext().getContext()).getRealPath(path);
}