shiro缓存配置
2024-09-06 11:29:40
realm的缓存
方法一:
在securityManager配置中添加cacheManager配置项,会注入到realm中。
方法二:在realm中配置。
realm本身实现了CacheManagerAware接口
public interface CacheManagerAware { /**
* Sets the available CacheManager instance on this component.
*
* @param cacheManager the CacheManager instance to set on this component.
*/
void setCacheManager(CacheManager cacheManager);
}
securityManager不只会帮realm注入cacheManager,还会帮sessionManager注入cacheManager
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="cacheManager" ref="redisCacheManager" />
<property name="realm" ref="myRealm" />
<property name="sessionManager" ref="sessionManager"/>
</bean>
这样的话,realm和sessionManager就不用再配缓存
最新文章
- seaJs学习笔记2 – seaJs组建库的使用
- Bootstrap3系列:按钮式下拉菜单
- [转]10个有关RESTful API良好设计的最佳实践
- Gson运用
- JS调用腾讯接口获取天气
- UI实时预览最佳实践(转)
- sublime vue 语法高亮插件安装
- Python 解LeetCode:671. Second Minimum Node In a Binary Tree
- ionic 横向滚动 ion-scroll 进度条(步骤)// 根据后台数据控制当前默认滑动到的位置
- diffMerge安装配置使用
- spring注解-@Transactional事务几点注意
- (11)Microsoft office Word 2013版本操作入门_word中表格操作
- python中matplotlib画图
- delphi 调用QQ邮箱发送邮件
- 【工具相关】Web-Sublime Text2-安装插件HTMLPrettify
- Tensorflow[目录结构]
- Is this Sentence Difficult? Do you Agree? -paper
- 02 JDBC相关
- Freemarker全部文档和具体实例
- 一个关于react-native的demo,详细请转GitHub
热门文章
- jsp遍历集合
- login() got an unexpected keyword argument &#39;extra_context&#39;
- RuntimeError: cuda runtime error (10) : invalid device ordinal
- Struts2高级(插件)笔记一
- git——解决每次拉取、提交代码时都需要输入用户名和密码
- Go的WaitGroup
- Week of Code:GG
- C++11类内static成员变量声明与定义
- C++11通过拷贝构造器拷贝const字段(待解决)
- $.fn.exted({})与$.extend({})区别