private void setProperty(OgnlContext context, String key, String[] values, List<Message> errors) {
try {
logger.debug("Applying {} with {}",key, values);
Ognl.setValue(key, context, context.getRoot(), values.length == 1 ? values[0] : values);
} catch (ConversionError ex) {
errors.add(new ValidationMessage(ex.getMessage(), key));
} catch (MethodFailedException e) { // setter threw an exception
Throwable cause = e.getCause();
if (cause.getClass().isAnnotationPresent(ValidationException.class)) {
errors.add(new ValidationMessage(cause.getLocalizedMessage(), key));
} else {
throw new InvalidParameterException("unable to parse expression '" + key + "'", e);
}
} catch (NoSuchPropertyException ex) {