Shiro教程(一)Maven管理Shrio Jar包

Apache Shiro Java  的一个安全框架。我们经常看到它被拿来和 Spring  Security  来对比。大部分人认为 Shiro  Security  要简单,然后说 Shiro  Security  要简单。我的观点赞成一半一半吧。

首先 Shiro  确实和 Security  是同类型的框架,主要用来做安全,也就是我们俗称的权限校验(控制)。居多人对 Shrio  的定义为好入门。



我的项目是用 Maven  管理的Jar 包,如果不了解 Maven  ,不会 Maven  的,可以找我要学习视频。下面把 Shiro  要用的JarMaven 的配置。

在pom.xml配置文件中,配置

  1. <!-- shiro begin -->
  2. <dependency>
  3. <artifactId>quartz</artifactId>
  4. <groupId>org.opensymphony.quartz</groupId>
  5. <version>1.6.1</version>
  6. </dependency>
  7. <dependency>
  8. <groupId>org.apache.shiro</groupId>
  9. <artifactId>shiro-core</artifactId>
  10. <version>1.2.2</version>
  11. </dependency>
  12. <dependency>
  13. <groupId>org.apache.shiro</groupId>
  14. <artifactId>shiro-web</artifactId>
  15. <version>1.2.2</version>
  16. </dependency>
  17. <dependency>
  18. <groupId>org.apache.shiro</groupId>
  19. <artifactId>shiro-quartz</artifactId>
  20. <version>1.2.2</version>
  21. </dependency>
  22. <dependency>
  23. <groupId>org.apache.shiro</groupId>
  24. <artifactId>shiro-spring</artifactId>
  25. <version>1.2.2</version>
  26. </dependency>
  27. <!-- shiro end -->

如果是使用 EHCache  则还要添加下面的:

 
  1. <dependency>
  2. <artifactId>ehcache-core</artifactId>
  3. <groupId>net.sf.ehcache</groupId>
  4. <version>2.5.0</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>org.apache.shiro</groupId>
  8. <artifactId>shiro-ehcache</artifactId>
  9. <version>1.2.2</version>
  10. </dependency>

如果是用 Redis  则添加(推荐):

 
  1. <dependency>
  2. <groupId>redis.clients</groupId>
  3. <artifactId>jedis</artifactId>
  4. <version>2.1.0</version>
  5. </dependency>
原文地址: https://www.sojson.com/blog/130.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值