我正在使用具有名称空间配置的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