JSP中:${pageContext.request.contextPath}
利用EL表达式,相当于http://localhost:8080/应用名称
Jave类中:
String path = request.getScheme()
+"://"
+ request.getServerName()
+ ":" + request.getServerPort()
+ request.getContextPath()
普通的类中:String root = 类名称.class.getResource("/").getPath();
显示编译时类的根路径
在application、junit中: //D:/eclipse_juno_4.2/workspace/ims_plat_new/build/classes/
在tomcat服务器中: //D:/apache-tomcat-6.0.35_ims_plat/webapps/ims_plat_new/WEB-INF/classes/