Class CheckboxTag

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

    public class CheckboxTag
    extends AbstractSingleCheckedElementTag
    Databinding-aware JSP tag for rendering an HTML 'input' element with a 'type' of 'checkbox'.

    May be used in one of three different approaches depending on the type of the bound value.

    Approach One

    When the bound value is of type Boolean then the 'input(checkbox)' is marked as 'checked' if the bound value is true. The 'value' attribute corresponds to the resolved value of the value property.

    Approach Two

    When the bound value is of type Collection then the 'input(checkbox)' is marked as 'checked' if the configured value is present in the bound Collection.

    Approach Three

    For any other bound value type, the 'input(checkbox)' is marked as 'checked' if the configured value is equal to the bound value.
    Since:
    2.0
    Author:
    Rob Harrop, Juergen Hoeller
    See Also:
    Serialized Form