Overview
Because multiple authorization operations are required for each run, in order to avoid resource waste, add cache configuration for shiro
1. Import xml
2. Configure the cache in 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>