当用户访问特定的 Web 服务组时,我们需要对用户进行身份验证。为此,我们使用 auth-method FORM。
当用户在文本区域内输入信息并单击按钮时,应用程序将尝试调用 Web 服务。此 Web 服务是安全的,用户需要先进行身份验证。auth 表单将显示为弹出窗口(jquery 效果)。
这是代码:
<!DOCTYPE html>
...
<meta http-equiv="Cache-Control" content="no-store,no-cache,must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>
...
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="jquery.bpopup.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var $form = $('form');
;(function($) {
$(function() {
$('#update').bind('click', function(e) {
e.preventDefault();
$('#popupLogin').bPopup();
});
});
})(jQuery);
});
</script>
</head>
<body>
<div style="padding-left: 30px;">
<h1 style="padding-left: -20px;">Create a new <i>Clinic</i></h1>
<div id="popupLogin" style="display:none;">
<form action="j_security_check" method="post">
<div>
<table>
<tr>
<td><span>Username</span></td>
<td><input type="text" style="width: 50px;" name="j_username" /></td>
</tr>
<tr>
<td><span>Password</span></td>
<td><input type="password" style="width: 50px;" name="j_password" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Login" /></td>
</tr>
</table>
</div>
</form>
</div>
<form id="form">
Clinic Name: <input type="text" name="name" /><br /><br />
<input type="button" id="update" value="Add Clinic" />
</form>
</div>
问题是每当我提交正确的登录信息时,它都会重定向到这个 408 错误:
Etat HTTP 408 - 已超过登录过程允许的时间。如果您想继续,您必须单击两次并重新单击您请求的链接或关闭并重新打开您的浏览器
任何想法的解决方案?