Shiro教程(二)Shiro web.xml中Filter配置,配置注意事项
2018-03-14 16:59
435 查看
本教程是是采用 SpringMVC + Spring + Mybatis 框架集成的,需要配置的文件是
过滤器配置,在
在
1.如果你的项目动态请求都是
2.过滤器配置的顺序,过滤器最好配置的位置是在
原文地址:https://www.sojson.com/blog/131.html
web.xml,然后有一个和 Spring 的配置文件,我取名叫做
spring-shiro.xml,下面会一一讲解到。
过滤器配置,在
web.xml中配置:
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
在
web.xml文件配置中配置注意的问题点:
1.如果你的项目动态请求都是
*.action,
*.do等结尾,那么拦截配置就直接配置为
<url-pattern>*.action</url-pattern>或者
<url-pattern>*.do</url-pattern>
2.过滤器配置的顺序,过滤器最好配置的位置是在
org.springframework.web.filter.CharacterEncodingFilter之后,就是处理好字符集就是Shiro的过滤器。
原文地址:https://www.sojson.com/blog/131.html
相关文章推荐
- web.xml文件中配置ShallowEtagHeaderFilter需注意的问题
- Shiro在Web.xml中shiroFilter的Mapping配置错误
- web.xml配置注意事项
- Shiro在Web.xml中shiroFilter的Mapping配置错误
- Shire错误: Web.xml中shiroFilter的Mapping配置错误
- Servlet中web.xml文件的配置及注意事项(一)
- web.xml文件中配置(servlet, spring, filter, listenr)的加载顺序研究
- struts2 2.5以上版本安装中web.xml的配置(包括核心过滤器filter)
- filter以及filter的web.xml的配置
- Mac OS X Yosemite 10.10 配置 Apache+PHP 教程注意事项
- web.xml中同一servlet/filter配置多个url-pattern
- web.xml配置文件中的Servlet和filter区别?
- java中对于web.xml文件,filter的配置解释
- 【JavaWeb-22】slf4j和log4j的转化、一对一关系的配置、二级缓存的四种类别、阶段案例注意事项
- Tomcat5.5服务器web.xml下详细配置Filter
- Filter在web.xml中的配置顺序
- web.xml 中 resource-ref 的注意事项
- web.xml 配置Filter
- Filter过滤器中要注意的web.xml的事项
- web.xml文件中filter配置详解