gpt4 book ai didi

jsf - p :password doesn't redisplay prefilled model value

转载 作者:行者123 更新时间:2023-12-04 05:25:33 25 4
gpt4 key购买 nike

我有我这样的托管bean:

@ManagedBean 
@SessionScoped
public class utilisateur implements Serializable {

private String login ="yous" ;
private String password ="yous";
...
...

}

和我的login.xhtml
<h:outputText value="login: " />  
<p:inputText value="#{utilisateur.login}" />

<h:outputText value="password: " />
<p:password value="#{utilisateur.password}" />

因此,使用此配置时,默认情况下必须像 ****中的 p:password(yous)一样显示密码,但密码显示为空。

最佳答案

出于安全原因,这是默认行为。如果需要在提交或预设模型时显示模型中的密码,则需要将redisplay属性显式设置为true

<p:password value="#{utilisateur.password}" redisplay="true" />  

另请参见 the <p:password> VDL documentation,它是最后一个属性的前一个。

redisplay Boolean flag indicating whether or not a previously entered password should be rendered in form. Default is false.

关于jsf - p :password doesn't redisplay prefilled model value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10852520/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com