2018-08-31 11:02

不是 bug,你确定在后端能接收到 url 中的这个 '#' 字符?

这个字符出现在 url 之中,进在当前 html 页面中定位的,会滚动你的浏览器滚动条,与后端应该是无关的

2018-08-31 10:10

上面代码中的 redirect("/index.html"); 写错了,应该写成 render(...)

不能写成 redirect

2018-08-31 09:07

@nihaohaaaaa 把你自己的这个 filter 配置在 JFinalFilter 后面,改下 web.xml

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. ...")