[bv-dev] Nested message parameters and EL expressions

Emmanuel Bernard emmanuel at hibernate.org
Mon Nov 18 08:25:03 EST 2013


Depending how the spec is written it might already be too late but I
would definitely like something like that to happen.

We just need to be careful, which interpolation should happen first or
if we want to do them in a loop until the system rests.

On Mon 2013-11-18  9:32, Gunnar Morling wrote:
> Hi,
> 
> I came across an interesting case in the HV user forum [1], where a user is
> essentially nesting messages parameters within an EL expression:
> 
>     ${validatedValue > someValue ? '{x.y.z.message}' : '{x.y.w.message}'}
> 
> The expectation is that at first the two message parameters are resolved
> and then based on the conditional expression the outer EL expression either
> resolves to one message or the other.
> 
> This is currently not supported in HV, but reading the interpolation
> algorithm in the spec [2] I can't find anything indicating that this case
> would prohibited. On the other hand I'm not sure whether we intentionally
> meant to support it (at least it never occurred to me); if so, I think we
> should provide an example for this in the spec.
> 
> The use case seems valid to me, also for cases where one wants to refer to
> constraint attributes in conditional logic. Any thoughts?
> 
> --Gunnar
> 
> [1] https://forum.hibernate.org/viewtopic.php?f=9&t=1029782
> [2] http://beanvalidation.org/1.1/spec/#default-resolution-algorithm

> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev



More information about the beanvalidation-dev mailing list