java中获得系统路径

java中获得系统路径

在Application中:
System.getProperty("user.dir")

在Servlet中:
ServletContext servletContext = config.getServletContext();
String rootPath = servletContext.getRealPath("/");

在jsp中:
application.getRealPath("")

posted on 2004-12-08 10:20 云在青天水在瓶 阅读(1038) 评论(3) 编辑 收藏