1
我正在使用spring security登录+ ajax登录。如果用户提供了错误的凭据,我需要显示一条消息,指出“无效的用户/密码”使用spring security和ajax登录处理无效用户/密码
这是ajax登录jQuery代码。
$(document).ready(function(){
$('#login_btn').click(function(){
//alert("aaa"+validateLoginForm());
if(validateLoginForm()){
sprpst = 'j_username='+$('#j_username').val()+'&j_password='+$('#j_password').val();
$.post('j_spring_security_check',sprpst,function(data1) {
window.location.reload();
});
$.blockUI({ message : '<h1><img src="images/busy.gif" /> Loading...</h1>' });
}
});
});
这是春天的安全登录
<form-login login-page="/login" default-target-url="/deals" authentication-failure-url="/deals?login_error=1"/>
任何帮助将不胜感激。
谢谢:)
可以ü请自定义提供的链接/示例代码的AuthenticationEntryPoint – prakash 2013-03-26 10:04:47
我不知道我的回答是更新 – 2013-03-26 10:29:26
,可能是你需要将此代码放置在自定义的AuthenticationFailureHandler中。 – 2013-03-26 12:36:01