"args" : ["nutzbook"] // 对应shiro.ini中指定的ehcache.xml中定义的name
var ioc = {
"cacheManager" : {
"type" : "net.sf.ehcache.CacheManager",
"factory" : "net.sf.ehcache.CacheManager#getCacheManager",
"args" : ["nutzbook"] // 对应shiro.ini中指定的ehcache.xml中定义的name
}
/*
// 如果不需要shiro初始化的Ehcache, 使用下面的方式配置
"cacheManager" : {
"type" : "net.sf.ehcache.CacheManager",
"factory" : "net.sf.ehcache.CacheManager#create"
}
*/
};
shiro.ini中ehcache.xml的这个文件在哪里(maven项目)
[main]
nutzdao_realm = SimpleAuthorizingRealm
authc = org.nutz.integration.shiro.SimpleAuthenticationFilter
authc.loginUrl = /user/login
logout.redirectUrl= /user/login
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
cacheManager.cacheManagerConfigFile=classpath:ehcache.xml
#nutzdao_realm.cacheManager = $cacheManager
[urls]
/rs/* = anon
/user/logout = logout
/user/error = anon
/user/login = anon
/user/profile/active/mail = anon