2018-08-31 09:05

@房上的猫 莫非你是直接在浏览器请求的 html, 根本没走 render

2018-08-30 23:12

总之就是找准时机就可以了, ActiveRecordPlugin 这类插件是可以手动 start() 的,调用完就启动

2018-08-30 23:12

@nbjgl 在 configPlugin 中的最后,手动调用一下 arp.start() 这样就可以立即启动 ActiveRecordPlugin 了

然后就可以直接 Db.update(...) 了

2018-08-30 22:17

@libofei getModel 得会用,看一下 jfinal demo 中怎么用的,一定要注意前缀:
name="blog.title"
name="blog.content"

上面的 blog 这个前缀,正好是 getModel 第一个参数 “Blog" 的第一个字母变小写,就是 "blog"

你也可以打破上面的约定,手动指定:
getModel(Blog.class, "otherName")

以上就指定了 "otherName" 作为前缀,这个时候,在页面就可以这样:
name="otherName.title"
name="otherName.content"

2018-08-30 22:03

在 configConstant(Constants me) 中调用就好

2018-08-30 22:01

forwardAction(...) 即可

2018-08-30 21:59

getBean(Blog.class).setCreateTime(new Date()).save() 即可

如果没有生成 getter 方法,则用下面的办法:
getModel(Blog.class).set("createTime", new Date()).save()

2018-08-30 21:18

下载首页的 jfinal demo for maven 这个项目,看里面怎么用的,一看就会

2018-08-30 21:18

看一下是使用的是 jfinal 哪个版本,#(x.userName) 是 jfinal 3.0 以后才有的功能

此外,看一下是不是配置了 me.setViewType(...) 要去掉这个配置

2018-08-30 17:49

乱码问题单步调试一下,看是哪个环节乱的,设置一下即可

关键是单步调试定位

2018-08-30 17:47

用纯 sql 配合 Db.update(sql ) 解决,例如
Db.update("create table. ...")

2018-08-30 16:06

不加这一行,意味着 _MappingKit.java 这段代码是白给的,不起作用

注意看 jfinal demo 里的例子

2018-08-30 16:05

me.add(arp) 这一行前面添加一行代码:
_MappingKit.mapping(arp);

2018-08-30 12:04

jfinal 使用比较新的版本,新版本对各浏览器下的文件下载乱码的功能做了改进