src目录下资源路径的获取:
具体的类.class.getClassLoader().getResource(“资源名称”).getPath();
WebContent目录下资源路径的获取:
this.getServletContext().getRealPath(“资源名”);
资源路径获取
最新推荐文章于 2021-06-22 17:28:46 发布
src目录下资源路径的获取:
具体的类.class.getClassLoader().getResource(“资源名称”).getPath();
WebContent目录下资源路径的获取:
this.getServletContext().getRealPath(“资源名”);