|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
BeanValidator cannot resolve composite component values
I've logged an issue for this:
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1360 When baseClass is: class com.sun.faces.el.CompositeComponentAttributesELResolver$ExpressionEvalMap BeanValidator.isResolvable(...) returns false because ExpressionEvalMap is a Map -- and never attempts to traverse the composite component. This is a big problem with Bean Validation support, since probably the most attractive feature of JSF2 is composite components, and this means BeanValidation will not function at all within any composite components. // case 1, base classes of Map, List, or Array are not resolvable if (null != baseClass) { if (Map.class.isAssignableFrom(baseClass) || Collection.class.isAssignableFrom(baseClass) || Array.class.isAssignableFrom(baseClass)) { failureMessage = "Unable to validate expression " + valueExpression.getExpressionString() + " using Bean Validation. Expression evaluates to a Map, List or array."; result = false; } } This can be reproduced by using the following component, and an Object annotated with JSR303 annos. Consuming page: (I've also tried "value" as the for="..." attribute value with no success) <h:form> Example component: <html xmlns="http://www.w3.org/1999/xhtml" Example Object: public class ValidationCriteriaExampleBean @ManagedBean public class Bean { private ValidationCriteria test = new ValidationCriteria(); public ValidationCriteria getTest() { return test; } }
|
| Free embeddable forum powered by Nabble | Forum Help |