几种方式:建议使用第二种
1.String path = Thread.currentThread().getContextClassLoader()
.getResource("").getPath().replace("WEB-INF/classes", "resources");
2.String path=this.getClass().getResource("").getPath().replace("WEB-INF/classes/", "resources");
几种方式:建议使用第二种
1.String path = Thread.currentThread().getContextClassLoader()
.getResource("").getPath().replace("WEB-INF/classes", "resources");
2.String path=this.getClass().getResource("").getPath().replace("WEB-INF/classes/", "resources");