String path = new Object() {
public String getPath() {
return this.getClass().getResource("").getPath();
}
}.getPath();
普通方法: 直接用this.getClass().getResource("")
靜態方法: 根據上面方法獲取。
String path = new Object() {
public String getPath() {
return this.getClass().getResource("").getPath();
}
}.getPath();
普通方法: 直接用this.getClass().getResource("")
靜態方法: 根據上面方法獲取。
pom: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boo