In this tutorial, you see how to configure shiro-redis
in spring
framework
- Use the following comment to clone shiro-redis-spring-tutorial to your disk:
git clone https://github.com/alexxiyang/shiro-redis-spring-tutorial.git
- Modify redis service connection configuration in
src/main/resources/applicationContext.xml
<bean id="redisManager" class="org.crazycake.shiro.RedisManager">
<property name="host" value="127.0.0.1:6379"/>
</bean>
- Run jetty
mvn jetty:run
- Visit
http://localhost:8080
, you will see login page:
- Use the username and password wrote on login page to sign in. Then you will see the successful page:
- Use redis client to check redis data. For example, use
Redis Desktop Manager
:
It means shiro use redis as its session and cache solution successfully.
Please send email to alexxiyang@gmail.com
可以用中文