Annotation Interface StringCSVConversion


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

Defines a form field (whether on a Struts Action or model of ModelDriven Struts Action) should be parsed from comma separated values to some collection of String. Different separators can be set instead of comma. No error message can happen. Also, defines a view helper field receives a formatted string collection value.

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 String collection type field named by parsedFieldName
String collection type 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.
separator
Separator between text. Defaults to ','.
trim
Whether to trim whitespace from each entry using the trim function. Defaults to true.
  • Element Details

    • parsedFieldName

      String parsedFieldName
      Default:
      ""
    • separator

      String separator
      Default:
      ","
    • trim

      boolean trim
      Default:
      true