我的Spring MVC應用程序不允許任何登錄,我無法弄清楚爲什麼。爲什麼春季登錄表單不能顯示失敗登錄的任何錯誤信息?
我已經登錄到登錄控制器,但沒有輸出。
登錄頁面似乎自動重定向到錯誤頁面而無需通過登錄控制器。
任何想法如何調試此問題?
<http auto-config="false" access-decision-manager-ref="accessDecisionManager" use-expressions="true">
<intercept-url pattern="/login/**" access="hasRole('ROLE_ANONYMOUS')" requires-channel="${application.secureChannel}" />
<intercept-url pattern="/error/**" access="hasRole('ROLE_ANONYMOUS')" requires-channel="http" />
<intercept-url pattern="/register/**" access="hasRole('ROLE_ANONYMOUS')" requires-channel="${application.secureChannel}" />
<intercept-url pattern="/" access="hasRole('ROLE_ANONYMOUS')" requires-channel="http" />
<intercept-url pattern="/**" access="hasRole('ROLE_USER')" requires-channel="http" />
<form-login login-page="/login" login-processing-url="/login/submit" authentication-failure-url="/login/error" />
<logout logout-url="/logout" />
</http>
<authentication-manager alias="authenticationManager">
<authentication-provider user-service-ref="userDetailsService">
<password-encoder hash="sha-256" base64="true">
<salt-source user-property="salt" />
</password-encoder>
</authentication-provider>
</authentication-manager>
<beans:bean id="userDetailsService" class="com.my.UserDetailsServiceImpl">
</beans:bean>
<beans:bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
<beans:constructor-arg value="256" />
<beans:property name="encodeHashAsBase64" value="true" />
</beans:bean>
<beans:bean id="roleHierarchy" class="org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl">
<beans:property name="hierarchy">
<beans:value>
ROLE_ADMIN > ROLE_USER
ROLE_USER > ROLE_ANONYMOUS
</beans:value>
</beans:property>
</beans:bean>
<beans:bean id="accessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
<beans:property name="decisionVoters">
<beans:list>
<beans:bean class="org.springframework.security.web.access.expression.WebExpressionVoter">
<beans:property name="expressionHandler">
<beans:bean class="org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler">
<beans:property name="roleHierarchy" ref="roleHierarchy" />
</beans:bean>
</beans:property>
</beans:bean>
</beans:list>
</beans:property>
</beans:bean>
嗯,這將在很大程度上取決於你如何在XML中配置的東西,你可以發佈的任何機會? – 2010-09-25 23:20:39
是的。應該做到這一點。更新了問題。感謝您的提醒。 – Linc 2010-09-25 23:31:14