shiro篇:缓存配置

概述

因为每次运行都要进行多次授权操作,为了避免资源浪费,为shiro添加缓存配置
在这里插入图片描述

1.导入xml

2.applicationContext-shiro.xml中配置缓存

在这里插入图片描述
在这里插入图片描述

<!--===========ehcache配置开始============-->
    <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
        <property name="cacheManagerConfigFile" value="classpath:ehcache.xml"></property>
    </bean>
    <!--===========ehcache配置结束============-->

<!--缓存管理-->
        <property name="cacheManager" ref="cacheManager"></property>

猜你喜欢

转载自blog.csdn.net/qq_39773004/article/details/109092130