shiro 配置用户访问首页

1.配置用户首先访问指定的 链接,比如 index,而不是 /login

<!-- Shiro Filter -->
    <bean id="shiroSecurityFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
        <property name="filters">
            <map>
                <entry key="webFormAuthc" value-ref="webFormAuthenticationFilter" />
            </map>
        </property>
        <property name="securityManager" ref="securityManager" />
        <property name="loginUrl" value="/login" />
        <property name="successUrl" value="/index" />
        <property name="unauthorizedUrl" value="/index" />
        <property name="filterChainDefinitions">
            <value>

            / =anon
                /index                      = anon
                /resources/**               = anon
                /get-captcha                = anon
                /register/**                = anon
                /forget/**                  = anon
                /trun/link/**                  = anon
                /notice/**                  = anon
                /insuranceConsult/**        = anon
                /sanbiao/**        = anon
                /news/**                    = anon
                /shuffling/**               = anon
                /login                      = webFormAuthc
                /logout                     = logout
                /**                         = user
            </value>
        </property>
    </bean>

你可能感兴趣的:(shiro 配置用户访问首页)