org.springframework.web.servlet.tags.form

Class ButtonTag

  • All Implemented Interfaces:
    java.io.Serializable, DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, 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:
    Serialized Form
    • Field Detail

      • DISABLED_ATTRIBUTE

        public static final java.lang.String DISABLED_ATTRIBUTE
        The name of the 'disabled' attribute.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ButtonTag

        public ButtonTag()
    • Method Detail

      • setName

        public void setName(java.lang.String name)
        Get the value of the 'name' attribute.
      • setValue

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

        @Nullable
        public java.lang.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.
      • 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 java.lang.String getDefaultValue()
        Return the default value.
        Returns:
        the default value if none supplied
      • getType

        protected java.lang.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'.