/ / Apache ShiroがSpring MVCプロジェクトのURL例外を追加-java、spring、servlets、shiro、url-mapping

Apache ShiroはSpring MVCプロジェクトのURL例外を追加する - java、spring、servlets、shiro、url-mapping

Maven + Spring MVC + Apache Shiroを使用してシステムを開発しています。 これが私の白豆です

<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"/>

それらのBeanを追加した後。これで、すべてのリクエストがログインページにリダイレクトされます。

URL例外を追加する方法をさまよう。 「/ show」のように、ログインやその他の認証方法は要求されません。

回答:

回答№1は0

JSPに/ staticにないイメージまたはその他のリソースが含まれていますか?

「/ show」に関する質問に関しては、もう1つの「anon」行だけを追加します。