Annotation Interface BooleanConversion


@Documented @Inherited @Target(FIELD) @Retention(RUNTIME) public @interface BooleanConversion

Defines a form field (whether on a Struts Action or model of ModelDriven Struts Action) should be converted to a boolean or Boolean type. The value parses to true if it starts with '1', 't' or 'y' (lowercase or uppercase), otherwise false. No error message can happen. Also, defines a view helper field receives a formatted boolean value. This is the default converter for boolean and Boolean fields.

There are two modes of behaviour for conversion, depending on the type of form field.

Annotation Usage
Form field type Mode Description
String Pair conversion Converts string field value to boolean or Boolean field named by parsedFieldName
boolean or Boolean Auto conversion Converts directly from request parameter

Other parameters

parsedFieldName
If not empty string, name of field to contain parsed value. Defaults to 'parsed' plus capitalised field name, such as 'parsedLimit'. Only applies for pair conversion.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • parsedFieldName

      String parsedFieldName
      Default:
      ""