springboot项目 resources目录下的资源文件加载为null的解决办法

String path = “classpath:config/tenplate.html” 

File file =new File(path);

修改为

Resource resource = new DefaultResourceLoader().getResource(path);

InputStream is = resource.getInputStream();

posted @ 2021-04-09 16:03  十年之约2025  阅读(856)  评论(0)    收藏  举报