Details
Assignee
UnassignedUnassignedReporter
Gunnar MorlingGunnar MorlingParticipants
Gunnar MorlingHardy FerentschikComponents
Fix versions
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Gunnar Morling
Gunnar MorlingParticipants
Gunnar Morling
Hardy Ferentschik
Components
Fix versions
Priority
Created November 18, 2013 at 7:28 PM
Updated June 15, 2017 at 9:06 AM
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:
@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:
Mailing list discussion
Original forum post