我正在使用具有名稱空間配置的spring security3.1。如果我在瀏覽器中輸入上下文路徑的URL,而不是登錄頁面的完整URL,我想重定向到登錄頁面。彈簧安全3.1-重定向到具有上下文url的登錄頁面
例如,http://xxx:8080/context/
代替http://xxx:8080/context/login.html
我能夠用完整的URL http://localhost:8080/context/login.html
我曾嘗試下面的代碼顯示的登錄頁面:
<http auto-config='true' authentication-manager-ref="authentication-manager" entry-point-ref="authenticationEntryPoint">
<beans:bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
<beans:property name="loginFormUrl" value="/login.html"/>
<beans:property name="forceHttps" value="true"/>
</beans:bean>
....
我爲了加入一個LoginUrlAuthenticationEntryPoint
進入也重定向到登錄頁面,但它似乎不工作。
你能解釋一下看起來不行嗎?你收到一個空白頁嗎?你是如何配置url模式的? – Ravi 2012-07-23 16:17:39