0
私はMaven + Spring MVC + Apache Shiroでシステムを開発しています。 私の白豆ですApache ShiroはSpring MVCプロジェクトのURL例外を追加します
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="sessionMode" value="native"/>
</bean>
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"/>
<property name="loginUrl" value="/login.jsp"/>
<property name="filters">
<util:map>
<entry key="authc">
<bean class="org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter"/>
</entry>
</util:map>
</property>
<property name="filterChainDefinitions">
<value>
/static/** = anon
/index.jsp = anon
/login.jsp = anon
/user/login = anon
/user/register = anon
/client/face = anon
/user/logout = logout
/** = authc
</value>
</property>
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
これらの豆を追加した後です。これですべてのリクエストがログインページにリダイレクトされます。
URL例外を追加する方法をさまよいます。 "/ show"のように、ログインやその他の認証方法については尋ねられません。