springMvc+shiro做权限管理,过滤静态文件

在shiroFilter 和 mvc:resources中都需要配置,

如:

shiroFilter中:

<property name="filterChainDefinitions">
    <value>
        /css/** = anon
        /js/** = anon
        /img/** = anon
    </value>
</property>

 在spring-mvc.xml中:

<mvc:resources mapping="/css/**" location="/css/" cache-period="2592000"/> 
<mvc:resources mapping="/img/**" location="/img/" cache-period="2592000"/> 
<mvc:resources mapping="/js/**" location="/js/" cache-period="2592000"/>

 

猜你喜欢

转载自mengxiang-it.iteye.com/blog/2397560