All Implemented Interfaces:
DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, Serializable, EditorAwareTag

public class ButtonTag extends AbstractHtmlElementTag
The <button> tag renders a form field label in an HTML 'button' tag. It is provided for completeness if the application relies on a RequestDataValueProcessor.

Attribute Summary

Attribute Required? Runtime Expression? Description

disabled

false

true

HTML Optional Attribute. Setting the value of this attribute to 'true' will disable the HTML element.

id

false

true

HTML Standard Attribute

name

false

true

The name attribute for the HTML button tag

value

false

true

The name attribute for the HTML button tag

Since:
3.1
Author:
Rossen Stoyanchev
See Also:
  • Field Details

    • DISABLED_ATTRIBUTE

      public static final String DISABLED_ATTRIBUTE
      The name of the 'disabled' attribute.
      See Also:
  • Constructor Details

    • ButtonTag

      public ButtonTag()
  • Method Details

    • setName

      public void setName(String name)
      Get the value of the 'name' attribute.
    • getName

      @Nullable public String getName()
      Set the value of the 'name' attribute.
      Overrides:
      getName in class AbstractDataBoundFormElementTag
      Returns:
      the value for the HTML 'name' attribute
    • setValue

      public void setValue(@Nullable String value)
      Set the value of the 'value' attribute.
    • getValue

      @Nullable public String getValue()
      Get the value of the 'value' attribute.
    • setDisabled

      public void setDisabled(boolean disabled)
      Set the value of the 'disabled' attribute.
    • isDisabled

      public boolean isDisabled()
      Get the value of the 'disabled' attribute.
    • writeTagContent

      protected int writeTagContent(TagWriter tagWriter) throws JspException
      Description copied from class: AbstractFormTag
      Subclasses should implement this method to perform tag content rendering.
      Specified by:
      writeTagContent in class AbstractFormTag
      Returns:
      valid tag render instruction as per Tag.doStartTag().
      Throws:
      JspException
    • writeValue

      protected void writeValue(TagWriter tagWriter) throws JspException
      Writes the 'value' attribute to the supplied TagWriter. Subclasses may choose to override this implementation to control exactly when the value is written.
      Throws:
      JspException
    • getDefaultValue

      protected String getDefaultValue()
      Return the default value.
      Returns:
      the default value if none supplied
    • getType

      protected String getType()
      Get the value of the 'type' attribute. Subclasses can override this to change the type of 'input' element rendered. Default value is 'submit'.
    • doEndTag

      public int doEndTag() throws JspException
      Closes the 'button' block tag.
      Specified by:
      doEndTag in interface Tag
      Overrides:
      doEndTag in class TagSupport
      Throws:
      JspException