Release Notes for 1.7

Breaking Changes

Actions must implement Log4J2 logger, since 1.7.1

Form field conversion and validation can write messages to logs instead of to the user, so Actions must implement the abstract LoggingAware.getLogger(), usually its own logger. Logged messages are usually about buggy URL parameters set by developer, not the user, and using the Action's logger separates client code logs from library logs.

New Features

Bespoke annotations and polices, since 1.7.0

Bespoke polices are client written policies with a specific, client written annotation that configures it. They require more work than custom policies but are more descriptive and are more sophisticated. See Form Field Annotations - Custom and Bespoke.

Warning messages, since 1.7.0

Like action messages, Actions can accept warning messages so they're displayed to the user but in a different colour. Actions must be a subclass of AbstractActionSupport or otherwise implement ValidationAware2. See Warning Messages.

Alternate Client Written Policy Lists, since 1.7.0

AnnotationValidationInterceptor2 and FormFormatterInterceptor can be overridden and StrutsMiscellaneousLibrary.updateDisplayWithPolicyLookup use an alternate, client written set of policies. This is really a side effect of run-time searching for bespoke policies and unlikely to be useful.

Improvements

Manual parameter conversion can write warning messages, since 1.7.3

Forms needing manual parameter conversion should implement Form.manualParameterConvert2() as it can write warning messages. Form.manualParameterConvert() is deprecated.

DefaultPolicyLookup reads directly from struts.xml, since 1.7.3

DefaultPolicyLookup reads directly from struts.xml, rather than rely on injection of interceptors, for compatibility with Actions using older interceptor stacks.

Templates for bespoke converters and collection converters that only format, since 1.7.3

AbstractFormatterSupport and AbstractListFormatterSupport can be used by bespoke converters only for formatting.

Retrofitted default message type to AnnotationValidationInterceptor, since 1.7.3

Retrofitted default message type to the deprecated AnnotationValidationInterceptor to work with annotations that leave message type to default.

BooleanConverter recognises default value for checkboxes, since 1.7.2

Previously, BooleanConverter only recognised values starting with '1', 't', or 'y' (lowercase or uppercase), which did not include the default value for checkboxes of 'on'.

Template classes for grouped and multi drop-down lists, since 1.7.2

GroupedSingleSelectBoxDisplay and GroupedEnumSingleSelectBoxDisplay aids creating SELECT tags containing OPTGROUPs. MultiSelectBoxDisplay is for SELECT tags with MULTIPLE attribute.

Support for viewer Actions receiving parameters, since 1.7.1

Previously, AnnotationValidationInterceptor2 could be enabled for viewer Actions that receive URL parameters but they rarely have forms for receiving parameters, so validation would waste time with display fields. Now, by default, the interceptor is always enabled but only fields explicitly annotated for form validation are checked. This includes the FormField annotation.

Conversion and validation failures can write to logs instead, since 1.7.1

Annotations for converters and validators, such as IntegerConversion, can set messages written to logs rather than displayed to the user. Writing to logs, even ERROR level, does not trigger form rejection. This is useful for viewer Actions receiving URL parameters. The default setting action error for form processing Actions and log at WARN level for viewer Actions.

Display formatting supports collection and array fields, since 1.7.0

Previously, StrutsMiscellaneousLibrary.updateDisplay could only format single value string fields from a matching, single value field of a source record. Formatting from an array or collection to matching array or collection is now supported.

Bug Fixes

Since 1.7.1