Jfinal中使用redis

 配置文件中:

1 @Override
2 public void configPlugin(Plugins me) {
3   RedisPlugin redis=new RedisPlugin("自定义cache名字", "地址(默认为127.0.0.1)","连接密码(有就填,没得就不要这个参数)");
4   me.add(redis);
5 }

控制器中:

 1 public class UserController extends Controller{
 2 
 3 
 4   public void index() {
 5     // 获取名称为bbs的Redis Cache对象
 6     Cache bbsCache = Redis.use("bbs");
 7     bbsCache.set("key", "value");
 8     bbsCache.get("key");
 9 
10     System.out.println("_______________:"+bbsCache.get("key"));
11   }
12 }
原文地址:https://www.cnblogs.com/lihongjunjava/p/9355198.html