在Application中: System.getProperty("user.dir") 在Servlet中: ServletContext servletContext = config.getServletContext(); String rootPath = servletContext.getRealPath("/"); 在jsp中: application.getRealPath("") 相关文章: