我正在Spring上开发Web应用程序,使用Spring Security 3和LDAP进行身份验证。spring security 3 authentication-failure-url change
这是我的代码的形式登录片段:
<security:form-login
authentication-failure-url="/index.xhtml?error=true"
default-target-url="/SomeDefaultUrl.xhtml"
login-page="/index.xhtml" />
身份验证失败时我的应用程序将被重定向到“/index.xhtml?error=true”网址。问题是我不知道如何捕获“error”变量并在index.xhtml文件中显示一些身份验证失败消息。我没有使用Spring mvc。
第二个问题是更改authentication-failure-url不起作用。
<security:form-login
authentication-failure-url="/error.xhtml"
default-target-url="/SomeDefaultUrl.xhtml"
login-page="/index.xhtml" />
我改变了认证失败的URL,但尽管这样的改变,它仍然重定向到的index.xhtml文件,而无需任何变量。
我怎样才能解决这个问题?
谢谢你的伟大的建议。 关于第二个问题:我重建项目,它注意到我的变化,因为它被重定向到'index.xhtml'文件而不是'index.xhtml?error = true' 我认为当authentication-failure-url参数的值不是_acceptable_它会自动重定向到index.xhtml。但我不知道如何解决它 – mariami