JBoss EL‎ > ‎

Resolve messages inline

This is a simple one yet its amazing how often you may need it. Suppose you want to display a message from a resource bundle but it contains placeholders for variable substitution such as:

validation_message=The value {0} must be between {1} and {2}


You could create a java method to return the fully substituted string or you could do it in EL!

#{interpolator.interpolate(messages['validation_message'], value, minValue, maxValue)}

Comments