This issue can't be edited

Because it belongs to an archived project. Jira admins can restore projects from the archive.

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:

@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

Activity

Show:

Hardy FerentschikNovember 18, 2013 at 7:38 PM

I am not sure whether this is the right perspective. I still see the whole ${...} as a single EL expression which is supposed to be evaluated by the EL engine. Whether we then loop back to message parameter resolution is a different question. I agree it might be useful.

Details

Assignee

Reporter

Participants

Gunnar Morling
Hardy Ferentschik

Components

Fix versions

Priority

Created November 18, 2013 at 7:28 PM
Updated June 15, 2017 at 9:06 AM

Flag notifications