java中获得系统路径

来源:互联网 发布:qq等级加速软件 编辑:程序博客网 时间:2024/05/04 20:43
在Application中:
System.getProperty("user.dir")
在Servlet中:
ServletContext servletContext = config.getServletContext();
String rootPath = servletContext.getRealPath("/");
在jsp中:
application.getRealPath("")
原创粉丝点击