2019-05-08 10:11
@JFinal 我知道了需要在undertow.resourcePath=src/main/webapp,webapp后面再添加一个目录即可
2019-05-08 10:00
@JFinal
这个官网demo项目,我就在undertow.resourcePath后面添加了一个静态资源目录,然后其他都没动,在idea中可以运行,mvn 打包后,运行不起来,提示,在我添加的那个静态资源目录下缺少引擎模板文件,但是这个undertow.resourcePath不是可以随意添加的吗?怎么会影响到webapp里面的内容呢,不应该是webapp和我自定义添加的目录都是静态资源目录吗?哪个里面有需要的资源从哪里读取
2019-05-08 09:05
@JFinal
当这个
engine.setToClassPathFactory();
engine.setBaseTemplatePath(basePath);
修改过之后,controller对应的视图路径是不是也改变了?会出现500,
java.lang.IllegalArgumentException: File not found in CLASSPATH or JAR : "static/index/index.html"
2019-05-08 08:37
@JFinal 感谢ths,重新编译下确实能解决问题了,从idea中copy和从文件管理中直接copy一样了
2019-05-07 18:29
@JFinal 通过idea进行复制和移动到resource目录下依然会出错,但是从文件管理里面复制移动 ,运行就不报错,很奇怪
2019-05-07 17:51
@JFinal 修改之后运行报这个错误
java.lang.IllegalArgumentException: File not found in CLASSPATH or JAR : "webapp/common/_layout.html"
at com.jfinal.template.source.ClassPathSource.(ClassPathSource.java:67)
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.demo.common.DemoConfig.configEngine(DemoConfig.java:79)
at com.jfinal.core.Config.configJFinal(Config.java:57)
at com.jfinal.core.JFinal.init(JFinal.java:61)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:63)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)
at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:589)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:554)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:596)
at com.jfinal.server.undertow.UndertowServer.configHttp(UndertowServer.java:284)
at com.jfinal.server.undertow.UndertowServer.doStart(UndertowServer.java:262)
at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:159)
at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:84)
at com.demo.common.DemoConfig.main(DemoConfig.java:34)
2018-07-16 10:28
@qin 这个问题我也不知道最后怎么弄的,我直接取消了自动打开浏览器,你看看你项目存不存在上面说的那种问题