一、src下的类路径获取方式:
String absoultPath = Thread.currentThread().getContextClassLoader().getResource("类的根路径作为起点的路径").getPath();
String Path1 = Thread.currentThread().getContextClassLoader().getResource("com/bj/t1/application.properties").getPath();
二、如何获得项目跟路径下的路径(WebContent)Context-Root:
ServletContext application = this.getServletContext();
String absoultPath = application.getRealPath("temp");