0

When traversing the source code for UISelectOne, I came across the following piece of code within the protected void validateValue(FacesContext context, Object value) method:

boolean found = SelectUtils.matchValue(getFacesContext(),
                                               this,
                                               value,
                                               new SelectItemsIterator(context, this),
                                               getConverter());

Consider the following declaration:

<h:selectOneRadio value="#{bean.pr}" converter="Conv" required="true" requiredMessage="msg">
    <f:selectItems value="#{bean.dates}" />
</h:selectOneRadio>

The converted value should be equal to one of the values I've populated the list with. The actual value has a different type than expected, so I get a validation error.

Question: Why is the converted value not consistent with the validated value?

Tiny
  • 27,221
  • 105
  • 339
  • 599
St.Antario
  • 26,175
  • 41
  • 130
  • 318
  • This is covered by http://stackoverflow.com/q/9069379 (safeguard against manipulated/tampered/hacked requests). Is this acceptable as dupe? – BalusC Aug 11 '15 at 15:36
  • @BalusC I just wanted to know the reasond for the `SelectUtils.matchValue` method performing the searching through the `SelectItem`s. Now the reason is clear (safeguard). So yes, it is. – St.Antario Aug 11 '15 at 16:57

0 Answers0