img src写一个后端展示图片的请求路径 图片能返回展示 却报错
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.RuntimeException: File not found :
at com.jfinal.template.source.FileSource.getContent(FileSource.java:70) ~[enjoy-3.6.jar:?]
FileSource.java:70
at com.jfinal.template.Engine.buildTemplateBySourceFactory(Engine.java:159) ~[enjoy-3.6.jar:?]
Engine.java:159
at com.jfinal.template.Engine.getTemplate(Engine.java:144) ~[enjoy-3.6.jar:?]
Engine.java:144
at com.jfinal.template.ext.spring.JFinalView.renderMergedTemplateModel(JFinalView.java:62) ~[enjoy-3.6.jar:?]
JFinalView.java:62
项目:JFinal
与 Spring 整合要注意 baseTemplatePath 配置问题,如果是 springboot ,模板文件是放在 src/main/resources 目录下面的,注意配置好 baseTemplatePath
此外注意,配置模板加载方式,默认是从文件系统中加载,可以配置成从 class path 与 jar 包中加载:
jfr.setSourceFactory(new ClassPathSourceFactory());
文档中都有:
https://www.jfinal.com/doc/6-10