📜  Primefaces密码

📅  最后修改于: 2021-01-08 04:19:24             🧑  作者: Mango

PrimeFaces密码

它是一个输入字段,从用户那里获取隐藏的值。 组件用于在JSF应用程序中创建密码字段。它还在输入密码时提供反馈。它具有下表列出的各种属性。

密码属性

Attribute Default value Type Description
required false Boolean It is used to mark component as required.
feedback false Boolean It enables strength indicator.
inline false Boolean It displays feedback inline rather than using a popup.
promptLabel Please enter a password String It is a label of prompt.
weakLabel Weak Boolean It is used to set label of weak password.
goodLabel good String It is used to set label of good password.
strongLabel strong String It is used to set label of strong password.
redisplay false Boolean It is used to display previous value.
match null String It matches id of another password component to match value against.
maxlength null Integer It is used to set maximum number of characters that may be entered in
this field.
placeholder null String It specifies a short hint.
readonly false Boolean It is used to set component readonly.
size null Integer Number of characters used to determine the width of the
input element.
style null String It is used to set inline CSS of the input element.
tabindex null Integer It is used to set position of the input element in the tabbing order.
title null String It is used to set advisory tooltip information.

在下面的示例中,我们正在实现组件。本示例包含以下文件。

JSF文件

// password.xhtml





Password













ManagedBean

// Password.java

package com.javatpoint;
import javax.faces.bean.ManagedBean;
@ManagedBean
public class Password {
private String passwordField1;  
private String passwordField2;  
public String getPasswordField1() {
return passwordField1;
}
public void setPasswordField1(String passwordField1) {
this.passwordField1 = passwordField1;
}
public String getPasswordField2() {
return passwordField2;
}
public void setPasswordField2(String passwordField2) {
this.passwordField2 = passwordField2;
}
}

输出: