现在的位置: 首页 > 综合 > 正文

java中如何获得系统路径

2018年02月02日 ⁄ 综合 ⁄ 共 210字 ⁄ 字号 评论关闭
在Application中: 
 System.getProperty("user.dir") 
 在Servlet中: 
 ServletContext servletContext = config.getServletContext(); 
 String rootPath = servletContext.getRealPath("/"); 
 在JSP中:
 application.getRealPath("")  
 

抱歉!评论已关闭.