Spring <form:password> 不记得 multiform 向导中的值

VPK*_*VPK 3 spring jsp spring-mvc spring-session

我在 Spring<form:password>标签中使用密码字段,如下所示,

<form:input path="extBtsBaseDto.extBtsRedmineConnectionDto.basicPassword"/>
Run Code Online (Sandbox Code Playgroud)

我正在使用它在作为许多其他屏幕一部分的屏幕中从用户那里获取密码。这些屏幕用作向导,我使用 Session 将值保存在我的主屏幕 DTO 上。我上面提到的密码是绑定在内部 DTO 中的。

问题:假设当我通过将数据从屏幕 A 提交到 B 进行导航时,我在屏幕 A 中有密码字段,我可以在 B 处获得密码,但在接下来的屏幕中它从 DTO 中消失了。

我可以通过用<form:password>普通的 HTML 标签替换 Spring标签来解决这个问题,但想知道为什么会发生这种情况,如果有任何解决方案,我想使用 Spring 标签。

如果有人想看我的代码,我可以分享。感谢您的时间。

Dav*_*nni 5

您是否已经尝试使用

showPassword
Run Code Online (Sandbox Code Playgroud)

标签的属性?默认为 false,尝试设置为 true:

<form:password showPassword="true" path="extBtsBaseDto.extBtsRedmineConnectionDto.basicPassword"/> 
Run Code Online (Sandbox Code Playgroud)

文档