cache集成後添加shiro遇到的坑

話說:在項目後期,集成本應該最簡單的緩存功能,沒想到在單元測試時發現有些servers可以使用緩存,有些不行,換了ehcache2 和ehcache3都出問題,最後一步步集成,才發現是shiro的問題,巨坑~~~

 

不能在登錄認證中使用xxxServers,否則該servers用不了cache

protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token){
 
此間不能使用servers,用dao

}

 

授權部分倒是可以

protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals){

   此間可以有
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章