@IocBean
@At("/user")
public class UserModules {
@Inject
protected Dao dao; //就这么注入了,有@IocBean它才会生
@Inject JedisAgent jedisAgent;
@At
public void logout() {
Jedis jedis = jedisAgent.getResource();
String re = jedis.set("_nutzbook_test_key", "redis测试");
System.out.println("redis say : " + re);
re = jedis.get("_nutzbook_test_key");
System.out.println("从redis去除"+re);
session.invalidate();
}
}
redis.properties:
redis.host=localhost
redis.port=6379
redis.timeout=2000
redis.password=wendal.net
redis.database=0
redis.mode=cluster
项目报错:
org.nutz.ioc.IocException: [userModules, jedisAgent, conf] # For object [conf] - type:[]