FileDocCategorySizeDatePackage
Password.javaAPI DocExample2757Mon Jul 23 13:26:36 BST 2007org.apache.struts2.components

Password

public class Password extends TextField
Render an HTML input tag of type password.

Examples

In this example, a password control is displayed. For the label, we are calling ActionSupport's getText() to retrieve password label from a resource bundle.


<s:password label="%{text('password')}" name="password" size="10" maxlength="15" />

Fields Summary
public static final String
TEMPLATE
protected String
showPassword
Constructors Summary
public Password(com.opensymphony.xwork2.util.ValueStack stack, HttpServletRequest request, HttpServletResponse response)


           
        super(stack, request, response);
    
Methods Summary
public voidevaluateExtraParams()

        super.evaluateExtraParams();

        if (showPassword != null) {
            addParameter("showPassword", findValue(showPassword, Boolean.class));
        }
    
protected java.lang.StringgetDefaultTemplate()

        return TEMPLATE;
    
public voidsetShowPassword(java.lang.String showPassword)

        this.showPassword = showPassword;