Shiro
什么都不会的垃圾佬
这个作者很懒,什么都没留下…
展开
-
1.Shiro简介
1.简介Apache Shiro是Java的一个安全(权限框架)。Shiro可以非常容易的开发出足够好的应用,其不仅可以用在JavaSE环境中,也可以用在JavaEE环境中。Shiro可以完成:认证、授权、加密、会话管理、与Web集成、缓存等。下载:http://shiro.apache.org/2.3.功能简介:Authentication:身份认证/登录,验证用户是不是拥有相应的身份。Aut...转载 2018-05-11 23:13:02 · 141 阅读 · 0 评论 -
2.Shiro基本项目搭建
在web环境下使用Shiro,大部分情况下使用Shiro集成Spring加入需要的jar包配置spring和springmvc1.集成spring配置web.xml文件 <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:app...转载 2018-05-14 16:44:46 · 166 阅读 · 0 评论 -
3.Shiro工作流程
*不涉及源代码,只是运行流程继续第2部分,此时效果,可以正常访问login.jsp页面,其余页面或不存在的页面无法访问,并会重定向回login.jsp页面在web.xml中配置的ShiroFilter是程序的入口,因为可以拦截所有资源(*/)工作流程:1.因为在web.xml配置拦截所有资源,都会走ShiroFilter 2.在application.xml的filt...转载 2018-05-14 17:02:18 · 443 阅读 · 0 评论 -
4.Shiro_DelegatingFilterProxy
web.xml中class="DelegatingFilterProxy"中filtername标签值,与application.xml中class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"中bean id必须一致。若不一致, 则会抛出: NoSuchBeanDefinitionException. 因为 Shiro 会来IOC 容器...转载 2018-05-14 17:22:47 · 167 阅读 · 0 评论 -
5.Shiro_权限URL配置细节
在application.xml中,id为ShiroFilter的bean中,进行filterChainDefinitions配置,对URL进行配置URL配置细节[urls]部分的配置,其格式是:' url=拦截器[参数],拦截器[参数] '如果当前请求的url匹配[urls]部分的某个url模式,将会执行其配置的拦截器anon(anonymous)拦截器表示匿名访问(即不需要登录即可访问)au...转载 2018-05-14 17:38:04 · 1387 阅读 · 0 评论