java中获得系统路径

来源:互联网 发布:泰安中商网络正规吗 编辑:程序博客网 时间:2024/05/04 01:54
在Application中:
System.getProperty("user.dir")
在Servlet中:
ServletContext servletContext = config.getServletContext();
String rootPath = servletContext.getRealPath("/");
在jsp中:
application.getRealPath("")
原创粉丝点击