2017-05-01 09:49

https://my.oschina.net/jfinal/blog/353062
你头像需要换了,

2017-05-01 09:47

https://my.oschina.net/jfinal/blog/353062
先看说明书(手册)再耍嘛

2017-04-27 20:34

@杜福忠 如果回说:看不懂. 就再回复: xxx类第Y行

2017-04-27 20:31

@JFinal 很多人手册就是不看!... 明明写的很清楚了... 而且我每次读都会发现新大陆! 同事问问题的时候直接回: 手册第X页第Y行...

2017-04-27 19:40

记得导 jar 和配置 ehcache.xml

再死记一条:
与web环境唯一的不同是要手动调用一次相关插件的start()方法

调用插件的start()!调用插件的start()!调用插件的start()!2333333

2017-04-27 19:37

PropKit.use("a_little_config.txt");
DruidPlugin dp = new DruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password").trim());
ActiveRecordPlugin arp = new ActiveRecordPlugin("oracle", dp);
arp.addMapping("blog", Blog.class);
arp.setCache(new EhCache());
EhCachePlugin ecp = new EhCachePlugin();
// 与web环境唯一的不同是要手动调用一次相关插件的start()方法
ecp.start();
dp.start();
arp.start();
// 通过上面简单的几行代码,即可立即开始使用
new Blog().set("title", "title1").set("content", "cxt text").save();
new Blog().set("title", "title2").set("content", "cxt text").save();

//--------------------------------------------------------------------
// ----- 使用缓存
Blog blog = Blog.me.findFirstByCache("sampleCache2", "1", "select * from blog where id=?", 1);

2017-04-25 19:58

还有可以加拦截器, 根据你的规则,自己切就好了

2017-04-25 19:52

在"/"controller中的index方法中, 加个判断, if(已登录) 去首页, else 去登录页

2017-04-25 19:46

如果是拷贝model属性的话: model_1._setAttrs(model_2)

2017-04-25 13:40

小棉袄~很贴心~先点赞收藏

2017-04-19 09:34

加入俱乐部然后看源码咯! 非常的干净易读易懂

2017-04-19 09:16

#include

2017-04-15 14:47

还可以这样啊 :
public void testIAtom(){
final Ret ret = Ret.create("什么码?", "我不知道啊");
boolean tx = Db.tx(new IAtom(){
@Override
public boolean run() throws SQLException {
//操作1
ret.put("什么码?", "错误1");
//操作2
ret.put("什么码?", "错误2");
//操作3
ret.put("什么码?", "错误3");
//操作4
ret.put("什么码?", "错误4");
try {
//操作5

} catch (Exception e) {
ret.put("什么码?", "错误5");
return false;
}
return true;
}});
ret.put("成功没有?", tx);
renderJson(ret.getData());
System.out.println(tx);
System.out.println(ret.toString());
}

2017-04-15 14:26

用拦截器啊 ActiveRecord 支持声名式事务 手册5.5章处