开发者社区> 问答> 正文

shiro求救,陷入死循环了

参考springrain,我的配置文件如下application-shiro.xml
screenshot

展开
收起
a123456678 2016-03-16 15:17:45 4279 0
1 条回答
写回答
取消 提交回答
  • 应该就是配置的问题,给你一个我的配置参考下吧
    
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
        default-lazy-init="true">
    
        <description>Shiro Configuration</description>
    
        <!-- Shiro's main business-tier object for web-enabled applications -->
        <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"
            depends-on="userDao">
            <property name="realms">
                <list>
                    <ref bean="shiroDbRealm" />
                </list>
            </property>        
            <property name="cacheManager" ref="cacheManager" />
        </bean>
        <bean id="cacheManager" class="org.apache.shiro.cache.MemoryConstrainedCacheManager" />
    
    
        <!-- 項目自定义Realm -->
        <bean id="shiroDbRealm" class="x.x.x.x.ShiroDbRealm" />
        
    
        <!-- Shiro Filter -->
        <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
            <property name="securityManager" ref="securityManager" />
            <property name="loginUrl" value="/loginui" />
            <property name="successUrl" value="" />
            <property name="unauthorizedUrl" value="/loginui?unauthorized=true" />
            <property name="filterChainDefinitions">
                <value>
                    /weixin/**=anon
                    /loginui = anon
                    /loginrdct = anon
                    /logoutrdct = anon
                    /createuserui = anon
                    /showList =    anon
                    /showDetail = anon
                    /findPassword/** = anon
                    /regui = anon
                    /register = anon
                    /regcheckcerifycode = anon
                    /checkVerifyCode = anon
                    /**/checkusername/** = anon
                    /reguser/** = anon
                    /login = anon
                    /logout = customLogoutFilter
                    /**/static/**= anon
                    /error/**=anon
                    /app/**=anon
                    /verifyCodeServlet = anon
                    /img/** = anon
                    /** = customAccessControlFilter,user
                    
                    
                </value>
            </property>
        </bean>
    
    
    </beans>
    2019-07-17 19:04:00
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
代码未写,漏洞已出——谈谈设计不当导致的安全问题 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载