<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/18 Hardy Ferentschik <span dir="ltr"><<a href="mailto:hardy@hibernate.org" target="_blank">hardy@hibernate.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hi,<br>
<br>
not the sure whether this is so easy. I think the case of nested parameters is not properly covered in the spec atm.<br>
A few comments inline<br>
<div class="im"><br>
On 18 Jan 2013, at 16:31, Gunnar Morling <<a href="mailto:gunnar@hibernate.org">gunnar@hibernate.org</a>> wrote:<br>
<br>
> I think the algorithm should cover for that case, even if we didn't plan for it.<br>
><br>
> 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.<br>
<br>
</div>I think that is basically missing. I am not sure whether it is a good idea to perform message parameter resolution within an EL expression.<br>
I’d rather loop back after EL evaluation and perform another message parameter resolution.<br></blockquote><div><br></div><div>Why would you do that though? Seems like the current algorithm covers that case already? Wouldn't it get more complicated by doing another loop?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
> So considering the following example:<br>
><br>
> @ThresholdMax(value=10, messageThreshold=50, message="${validatedValue > {messageThreshold} ? '{muchTooLarge.message}' : '{aBitTooLarge.message}'}")<br>
> int myInt = ...;<br>
><br>
> Then I'd say algorithm should transform the message like this:<br>
><br>
</div>> After step 3 (resource bundle replacements): "${validatedValue > {messageThreshold} ? 'Viel zu groß' : 'Zu groß’}"<br>
<br>
there is no need for {messageThreshold} in the comparison. The value for messageTreshold is already bound to the EL context. '${validatedValue > messageThreshold’<br>
is already sufficient.<br></blockquote><div><br></div><div>Yes, that's right indeed. I was under the assumption that constraint parameters are not available for EL interpolation but as you say they are. So the scenario really is using messages from the resource bundle.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also I rather just let the EL return {muchTooLarge.message} resp {aBitTooLarge.message} and then loop back, instead to do replacement with the expression first.<br></blockquote><div><br></div><div>What is the advantage of that? I fear changes to the algorithm might cause compatibility issues and it seems to work also without any changes.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
<br>
—Hardy<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<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>
</div></div></blockquote></div><br></div></div>