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