记录一下,获取相对路径

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_37351768/article/details/86132529

在servlet中获取类所在根相对路径:this.class.getClassLoader().getResource("/").getPath();

在App类静态方法中:App.class.getClass().getResource("/");

猜你喜欢

转载自blog.csdn.net/qq_37351768/article/details/86132529