Jsp Spring安全性和用户名/密码自动填充导航器
我已经使用Roo和gvnix插件为登录表单生成了以下JSP spring安全代码。身份验证工作正常,但我无法在导航器(Firefox,IE)中获得登录自动填充。他们只是建议保存一个我没有设置的“X”用户名,在返回表单时没有任何建议。我就是找不到为什么我键入的用户名没有保存。。。有什么想法吗? 多谢各位Jsp Spring安全性和用户名/密码自动填充导航器,jsp,spring-mvc,spring-security,spring-roo,Jsp,Spring Mvc,Spring Security,Spring Roo,我已经使用Roo和gvnix插件为登录表单生成了以下JSP spring安全代码。身份验证工作正常,但我无法在导航器(Firefox,IE)中获得登录自动填充。他们只是建议保存一个我没有设置的“X”用户名,在返回表单时没有任何建议。我就是找不到为什么我键入的用户名没有保存。。。有什么想法吗? 多谢各位 <div> <label for="j_username"> <spring:message code="security_login_fo
<div>
<label for="j_username">
<spring:message code="security_login_form_name"/>
</label>
<input id="username" name="j_username" style="width:150px" type="text"/>
<spring:message code="security_login_form_name_message" htmlEscape="false" var="name_msg"/>
<script type="text/javascript">
<c:set var="sec_name_msg">
<spring:escapeBody javaScriptEscape="true">${name_msg}</spring:escapeBody>
</c:set>
Spring.addDecoration(new Spring.ElementDecoration({elementId : "j_username", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "${sec_name_msg}", required : true}}));
</script>
</div>
<div>
<label for="j_password">
<spring:message code="security_login_form_password"/>
</label>
<input id="j_password" name="j_password" style="width:150px" type="password"/>
<spring:message code="security_login_form_password_message" htmlEscape="false" var="pwd_msg"/>
<script type="text/javascript">
<c:set var="sec_pwd_msg">
<spring:escapeBody javaScriptEscape="true">${pwd_msg}</spring:escapeBody>
</c:set>
Spring.addDecoration(new Spring.ElementDecoration({elementId : "j_password", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "${sec_pwd_msg}", required : true}}));
</script>
</div>
<div class="submit">
<script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));</script>
<spring:message code="button_submit" htmlEscape="false" var="submit_label"/>
<input id="proceed" type="submit" value="${fn:escapeXml(submit_label)}"/>
</div>
${name_msg}
addDecoration(新的Spring.ElementDecoration({elementId:“j_username”,widgetType:“dijit.form.ValidationTextBox”,widgetAttrs:{promptMessage:${sec_name_msg}),必需:true});
${pwd_msg}
addDecoration(新的Spring.ElementDecoration({elementId:“j_password”,widgetType:“dijit.form.ValidationTextBox”,widgetAttrs:{promptMessage:${sec_pwd_msg}),必需:true});
addDecoration(newspring.ValidateAllDecoration({elementId:'procedure',event:'onclick'}));
从安全角度来看,自动完成用户名被认为是不好的做法
用户可以自由指示浏览器保存凭据信息并在自动完成操作中使用,但应用程序不应强制执行此行为
您的需求似乎比Spring框架更依赖于浏览器的细节
通常,可能值的自动完成意味着有人键入一个值,并且自动完成从存储器中获取满足条件(例如以开始)的所有值。我想你不希望有人能用这个自动完成功能从你的存储中取出你所有的用户名。我不明白你的意思。Firefox保存了许多网站的所有用户名,但我的应用程序除外,所以我猜它与Firefox无关,而是与我的应用程序有关。关于这种做法,我认为避免用户名和密码自动填充会提升弱密码这就是为什么在大多数地方创建新帐户时都有密码限制,如最小长度,所需符号等。