File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
spring-webflow/src/main/java/org/springframework/webflow/mvc/view Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2004-2012 the original author or authors.
2+ * Copyright 2004-2024 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
3737import org .springframework .binding .message .MessageCriteria ;
3838import org .springframework .binding .message .Severity ;
3939import org .springframework .core .convert .TypeDescriptor ;
40+ import org .springframework .lang .Nullable ;
4041import org .springframework .util .Assert ;
4142import org .springframework .validation .AbstractErrors ;
4243import org .springframework .validation .BindingResult ;
@@ -127,6 +128,12 @@ public List<FieldError> getFieldErrors(String field) {
127128 return toErrors (messageContext .getMessagesByCriteria (messageCriteria ), FIELD_ERRORS );
128129 }
129130
131+ // Override to ensure use of overridden getFieldErrors(String)
132+ public FieldError getFieldError (String field ) {
133+ List <FieldError > fieldErrors = getFieldErrors (field );
134+ return (!fieldErrors .isEmpty () ? fieldErrors .get (0 ) : null );
135+ }
136+
130137 public Class <?> getFieldType (String field ) {
131138 return parseFieldExpression (fixedField (field ), false ).getValueType (boundObject );
132139 }
You can’t perform that action at this time.
0 commit comments