shiro的URL配置
来源:互联网 发布:淘宝实拍保护怎么破解 编辑:程序博客网 时间:2024/06/04 18:45
让我们再次回忆一下spring容器中shirofilter的配置:
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="securityManager" ref="securityManager"/> <property name="loginUrl" value="/login.jsp"/> <property name="successUrl" value="/index.jsp"/> <property name="unauthorizedUrl" value="/unauthorized.jsp"/> <!-- The 'filters' property is not necessary since any declared javax.servlet.Filter bean defined will be automatically acquired and available via its beanName in chain definitions, but you can perform overrides or parent/child consolidated configuration here if you like: --> <!-- <property name="filters"> <util:map> <entry key="aName" value-ref="someFilterPojo"/> </util:map> </property> --> <property name="filterChainDefinitions"> <value> /favicon.ico = anon /logo.png = anon /shiro.css = anon /login.jsp = anon # allow WebStart to pull the jars for the swing app: /*.jar = anon # everything else requires authentication: /** = authc </value> </property> </bean>
在上述的配置文件中,有一个名为filterChainDefinitions的属性,定义的是拦截器链,在这里可以配置各种资源的URL被访问所需要的权限。
其格式是url=拦截器[参数],拦截器[参数],anon是anonymous的缩写,表示匿名访问,也就是说该资源无需登陆,authc则是authentication的缩写,表示需要身份认证通过之后才能访问。URL支持ANT风格。
URL匹配优先级的问题
URL匹配采取第一次匹配优先的方式,即当一个或多个资源同时适用多个拦截器时,从头开始起第一个匹配上的拦截器生效。
例如:
/bb/**=filter1
/bb/aa=filter2
/**=filter3
如果访问的URL是“/bb/aa”,按照第一次匹配优先的规则,该访问将由filter1进行拦截。
阅读全文
0 0
- shiro的URL配置
- 关于shiro的URL Path Expressions[url]配置
- 【Shiro权限管理】5. Shiro权限URL 配置细节
- shiro拦截url动态配置在数据库
- shiro之自动过虑URL,无需配置。
- shiro的配置学习
- 记录shiro的配置
- springboot + shiro的配置
- shiro的简单配置
- 3 shiro权限控制的配置(url和静态资源)
- shiro角色( roles)自定义Filter----同一个URL配置多个角色的或关系
- 【shiro】基于url的权限管理和shiro的对比
- Shiro第一篇【Shiro的基础知识、回顾URL拦截】
- Shiro的URL匹配规则(AntPathMatcher)
- shiro入门实战笔记(8)--Web项目Url配置
- spring 整合shiro ,并实现动态url 配置
- apache shiro的urls配置
- shiro---urls配置的研究
- 129. Sum Root to Leaf Numbers
- 【面向JS--HTML DOM常用对象】
- nginx的access.log文件详解,main的具体意思
- web服务器(epoll)
- 动态规划经典模型整理
- shiro的URL配置
- git本地仓库
- ftpd服务管理
- jquery学习(一)局部功能实现
- notifyAll()
- 异常-常用形式
- 20171109日记
- 自然语言处理入门——白话机器翻译原理
- Spring事物的再回顾