Clarify whether nesting of message parameters within EL expressions is legal

Description

While not explicitly stated, the algorithm for message interpolation also covers the case of nesting message parameters within EL expressions, which allows for use cases which refer to messages from the resource parameters or constraint attributes (which are resolved via parameter interpolation) which then are used within EL expressions. The following gives an example:

1 2 3 4 5 @ThresholdMax( value=10, messageThreshold=50, message="${validatedValue > {messageThreshold} ? '{muchTooLarge.message}' : '{aBitTooLarge.message}'}") int myInt = ...;

This case should be resolved by the algorithm as follows:

  • After step 3 (resource bundle replacements): ${validatedValue > {messageThreshold} ? 'Viel zu groß' : 'Zu groß'}

  • After step 4 (resolution of constraint attributes): ${validatedValue > 50 ? 'Viel zu groß' : 'Zu groß'}

  • After step 5 (EL evaluation): Viel zu groß or Zu groß, depending on the threshold value

To clarify that such nesting is considered legal, an example as this should be added to the spec and a test to the TCK.

References:

Environment

None

Status

Assignee

Unassigned

Reporter

Gunnar Morling

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major