shiro-redis

码农软件 · 软件分类 · 缓存系统 · 2019-08-30 08:59:54

软件介绍

shiro 的cache只提供了ehcache和concurrentHashMap的实现。这是一个redis 的cache实现。希望可以帮到你们

如何使用 

添加以下依赖到pom.xml

      org.crazycake      shiro-redis      2.4.2.1-RELEASE

如何配置
有2种配置方式:

  • ini文件

  • spring配置文件

ini方式:

#redisManager
redisManager = org.crazycake.shiro.RedisManager
#optional if you don't specify host the default value is 127.0.0.1
redisManager.host = 127.0.0.1
#optional , default value: 6379
redisManager.port = 6379
#optional, default value:0 .The expire time is in second
redisManager.expire = 30
#optional, timeout for jedis try to connect to redis server(In milliseconds), not equals to expire time! 
redisManager.timeout = 0
#optional, password for redis server
redisManager.password = 

#============redisSessionDAO=============
redisSessionDAO = org.crazycake.shiro.RedisSessionDAO
redisSessionDAO.redisManager = $redisManager
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
sessionManager.sessionDAO = $redisSessionDAO
securityManager.sessionManager = $sessionManager

#============redisCacheManager===========
cacheManager = org.crazycake.shiro.RedisCacheManager
cacheManager.redisManager = $redisManager
#custom your redis key prefix, if you doesn't define this parameter shiro-redis will use 'shiro_redis_session:' as default prefix
shiroCacheManager.keyPrefix = users:security:authz:
securityManager.cacheManager = $cacheManager

spring配置文件方式

        
    
    
    
    
                        /login.jsp = anon
            /user/** = anon
            /register/** = anon
            /unauthorized.jsp = anon
            /css/** = anon
            /js/** = anon

            /** = authc

就是这样,这么简单!

提供一个与springBoot集成的案列

http://z77z.oschina.io/2017/02/17/SpringBoot+Shiro%E5%AD%A6%E4%B9%A0%E4%B9%8B%E6%95%B0%E6%8D%AE%E5%BA%93%E5%8A%A8%E6%80%81%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E5%92%8CRedis%E7%BC%93%E5%AD%98/

本文地址:https://www.codercto.com/soft/d/13480.html

Python Data Structures and Algorithms

Python Data Structures and Algorithms

Benjamin Baka / Packt Publishing / 2017-5-30 / USD 44.99

Key Features A step by step guide, which will provide you with a thorough discussion on the analysis and design of fundamental Python data structures.Get a better understanding of advanced Python c......一起来看看 《Python Data Structures and Algorithms》 这本书的介绍吧!

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具