From 9c02444861cfc66b064ec7f3b66b6a2acc010031 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Wed, 14 May 2008 03:58:27 +0000 Subject: [PATCH] swf-664 --- build-spring-webflow/resources/changelog.txt | 1 + .../springframework/binding/message/MessageContextErrors.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build-spring-webflow/resources/changelog.txt b/build-spring-webflow/resources/changelog.txt index a1faa53d..8858f514 100644 --- a/build-spring-webflow/resources/changelog.txt +++ b/build-spring-webflow/resources/changelog.txt @@ -30,6 +30,7 @@ Bug Fixes * Fixed a bug resulting in loss of JSF ExternalContext state during execution of the JSF Lifecycle. This bug was effecting integration of the Trindad component library, which requires a special Response object to be set for its Ajax support to work. * Fixed a bug preventing resolution of flow-local messages for flows launched as subflows. +* Fixed a bug where field errors recorded using Errors.rejectValue were not being associated with the source field properly. Documentation * Added documentation on Spring Faces integration with Rich Faces, Trindad, and IceFaces. diff --git a/spring-binding/src/main/java/org/springframework/binding/message/MessageContextErrors.java b/spring-binding/src/main/java/org/springframework/binding/message/MessageContextErrors.java index 5f309ea4..d6363d6b 100644 --- a/spring-binding/src/main/java/org/springframework/binding/message/MessageContextErrors.java +++ b/spring-binding/src/main/java/org/springframework/binding/message/MessageContextErrors.java @@ -43,7 +43,8 @@ public class MessageContextErrors extends AbstractErrors { } public void rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage) { - messageContext.addMessage(new MessageBuilder().error().code(errorCode).defaultText(defaultMessage).build()); + messageContext.addMessage(new MessageBuilder().error().source(field).code(errorCode) + .defaultText(defaultMessage).build()); } public void addAllErrors(Errors errors) {