undertow 打包后找不到 common/_layout

AppConfig.java 107 行添加shareFunction的时候用到

me.addSharedFunction("/common/_layout.html");

不知道是不是哪里设置错了




Starting JFinal 4.2 -> http://0.0.0.0:17979

Info: jfinal-undertow 1.6, undertow 2.0.19.Final, jvm 1.8.0_161

java.lang.IllegalArgumentException: File not found in CLASSPATH or JAR : "webapp/common/_layout.html"

at com.jfinal.template.source.ClassPathSource.<init>(ClassPathSource.java:66)

at com.jfinal.template.source.ClassPathSourceFactory.getSource(ClassPathSourceFactory.java:29)

at com.jfinal.template.EngineConfig.addSharedFunction(EngineConfig.java:88)

at com.jfinal.template.Engine.addSharedFunction(Engine.java:246)

at com.oo.common.AppConfig.configEngine(AppConfig.java:107)

at com.jfinal.core.Config.configJFinal(Config.java:60)


评论区

aaaaaaa

2019-06-13 17:34

我把整个webapp 都放到resource目录下正常了

JFinal

2019-06-13 20:27

@aaaaaaa 注意区别 FileSourceFactory 与 ClassPathSourceFactory 的用法,文档中有详细的说明:
https://www.jfinal.com/doc/6-2

热门反馈

扫码入社