2020-07-10 14:30
你配置了下面这两个东东:
me.setToClassPathSourceFactory();
me.setSourceFactory(new MyClassPathSourceFactory());
其中第二个配置会覆盖掉第一个配置,因为这两个都是在配置 SoruceFactory
此外,如果你的模板在 classpath:templates文件中,可以这样配置:
me.setBaseTemplatePath("/templates");
me.setToClassPathSourceFactory();
然后用的时候就可以省去 "/templates" 目录,例如:
render("/index.html");
2020-07-10 11:54
先试试这个:
UndertowServer.create(...)
.configWeb(web -> {
web.addListener("...");
web.addInitParameter("...", "...");
})
.start();
如果上面这个不行,试一下这个:
UndertowServer.create(...)
.configWeb(web -> {
DeploymentInfo di = web.getDeploymentInfo();
di.xxx(...); // 这里调用 di 内的一些方法尝试实现功能
})
.start();
先通过 web.getDeploymentInfo() 获取到一个 DeploymentsInfo 对象,然对所有配置都可以通过这个对象中的方法来配置
2020-07-08 11:15
@zzutligang 只要是 JFinalJson.setXxx(...) 这种以 JFinalJson 打头的配置方法,全都是只针对 JFinalJson, 不影响 FastJson、Jackson ,各管各的配置
通用配置需要配置:
JsonManager.me().setXxx(...) 这个配置是管所有 json 实现的,注意看文档:
https://jfinal.com/doc/12-2
2020-07-07 21:55
@SuperEric jfinal 全家桶才最爽,使用 jfinal undertow 快两年了,再也离不开了