为什么要使用j_username和SPRING_SECURITY_LAST_USERNAME变量? [英] Why use the j_username and SPRING_SECURITY_LAST_USERNAME variables?

查看:241
本文介绍了为什么要使用j_username和SPRING_SECURITY_LAST_USERNAME变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么这样?

<input type="text" name="j_username" value="${SPRING_SECURITY_LAST_USERNAME}">

而不是这个?

<input type="text" name="username" value="">

j_username和SPRING_SECURITY_LAST_USERNAME变量的值是多少?

What's the value of the j_username and SPRING_SECURITY_LAST_USERNAME variables?

推荐答案

j_username j_password 是Java Servlet中的标准化名称规范,因此应用程序服务器(或servlet容器)了解它们,并且可以独立于应用程序执行容器身份验证。这允许例如单点登录到在同一应用服务器中部署的多个webapp。请参阅 JSR-154 中的SRV 12.5.3基于表单的身份验证一章。

j_username and j_password are standardized names in the Java Servlet specification, so the application servers (or servlet containers) know about them and can perform container authentication, independently of the application. This allows for example single-sign on into multiple webapps deployed in the same application server. See chapter "SRV 12.5.3 Form Based Authentication" in JSR-154

Spring Security常量只是为用户提供便利,因此他们不必重新输入用户名,如果Spring Security认出它们会自动建议用户名。

The Spring Security constant is just a convenience for users, so they don't have to re-enter their username, if Spring Security recognizes them it automatically suggests the username.

这篇关于为什么要使用j_username和SPRING_SECURITY_LAST_USERNAME变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆