Class TextField

Direct Known Subclasses:
ComboBox, Password

public class TextField extends UIBean

Render an HTML input field of type text

Examples

In this example, a text control for the "user" property is rendered. The label is also retrieved from a ResourceBundle via the key attribute.

 
 <s:textfield key="user" />
 
 
 
 <s:textfield name="user" label="User Name" />
 
 
  • Field Details

    • TEMPLATE

      public static final String TEMPLATE
      The name of the default template for the TextFieldTag
      See Also:
    • maxlength

      protected String maxlength
    • readonly

      protected String readonly
    • size

      protected String size
    • type

      protected String type
  • Constructor Details

    • TextField

      public TextField(ValueStack stack, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
  • Method Details

    • getDefaultTemplate

      protected String getDefaultTemplate()
      Description copied from class: UIBean
      A contract that requires each concrete UI Tag to specify which template should be used as a default. For example, the CheckboxTab might return "checkbox.vm" while the RadioTag might return "radio.vm". This value not begin with a '/' unless you intend to make the path absolute rather than relative to the current theme.
      Specified by:
      getDefaultTemplate in class UIBean
      Returns:
      The name of the template to be used as the default.
    • evaluateExtraParams

      protected void evaluateExtraParams()
      Overrides:
      evaluateExtraParams in class UIBean
    • setMaxlength

      public void setMaxlength(String maxlength)
    • setMaxLength

      public void setMaxLength(String maxlength)
    • setReadonly

      public void setReadonly(String readonly)
    • setSize

      public void setSize(String size)
    • setType

      public void setType(String type)