<div dir="ltr">I think the algorithm should cover for that case, even if we didn&#39;t plan for it.<div><br></div><div>In steps 1 - 4 only message parameters are resolved (against the resource bundles and then in step 4 against constraint attributes). Only in step 5 the EL evaluation is performed. There is no loop back to parameter resolution after EL interpolation.<div>
<br></div><div>So considering the following example:</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">    @ThresholdMax(value=10, messageThreshold=50, message=&quot;${validatedValue &gt; {messageThreshold} ? &#39;{muchTooLarge.message}&#39; : &#39;{aBitTooLarge.message}&#39;}&quot;)</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px">    int myInt = ...;</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Then I&#39;d say algorithm should transform the message like this:</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">After step 3 (resource bundle replacements): &quot;</span><span style="font-family:arial,sans-serif;font-size:13px">${validatedValue &gt; {messageThreshold} ? &#39;Viel zu groß&#39; : &#39;Zu groß&#39;}&quot;</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px">After step 4 (resolution of constraint attributes): &quot;</span><span style="font-family:arial,sans-serif;font-size:13px">${validatedValue &gt; 50 ? &#39;Viel zu groß&#39; : &#39;Zu groß&#39;}&quot;</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">After step 5 (EL evaluation): &quot;Viel zu groß&quot; or &quot;Zu groß&quot;, depending on the threshold value</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">--Gunnar</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/18 Emmanuel Bernard <span dir="ltr">&lt;<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Depending how the spec is written it might already be too late but I<br>
would definitely like something like that to happen.<br>
<br>
We just need to be careful, which interpolation should happen first or<br>
if we want to do them in a loop until the system rests.<br>
<div><div class="h5"><br>
On Mon 2013-11-18  9:32, Gunnar Morling wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I came across an interesting case in the HV user forum [1], where a user is<br>
&gt; essentially nesting messages parameters within an EL expression:<br>
&gt;<br>
&gt;     ${validatedValue &gt; someValue ? &#39;{x.y.z.message}&#39; : &#39;{x.y.w.message}&#39;}<br>
&gt;<br>
&gt; The expectation is that at first the two message parameters are resolved<br>
&gt; and then based on the conditional expression the outer EL expression either<br>
&gt; resolves to one message or the other.<br>
&gt;<br>
&gt; This is currently not supported in HV, but reading the interpolation<br>
&gt; algorithm in the spec [2] I can&#39;t find anything indicating that this case<br>
&gt; would prohibited. On the other hand I&#39;m not sure whether we intentionally<br>
&gt; meant to support it (at least it never occurred to me); if so, I think we<br>
&gt; should provide an example for this in the spec.<br>
&gt;<br>
&gt; The use case seems valid to me, also for cases where one wants to refer to<br>
&gt; constraint attributes in conditional logic. Any thoughts?<br>
&gt;<br>
&gt; --Gunnar<br>
&gt;<br>
&gt; [1] <a href="https://forum.hibernate.org/viewtopic.php?f=9&amp;t=1029782" target="_blank">https://forum.hibernate.org/viewtopic.php?f=9&amp;t=1029782</a><br>
&gt; [2] <a href="http://beanvalidation.org/1.1/spec/#default-resolution-algorithm" target="_blank">http://beanvalidation.org/1.1/spec/#default-resolution-algorithm</a><br>
<br>
</div></div>&gt; _______________________________________________<br>
&gt; beanvalidation-dev mailing list<br>
&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
<br>
_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
</blockquote></div><br></div>