版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_37351768/article/details/86132529
在servlet中获取类所在根相对路径:this.class.getClassLoader().getResource("/").getPath();
在App类静态方法中:App.class.getClass().getResource("/");
在servlet中获取类所在根相对路径:this.class.getClassLoader().getResource("/").getPath();
在App类静态方法中:App.class.getClass().getResource("/");