From 855182fb0b84e11a7df14a40e0729a85c4f11bb8 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Wed, 15 Oct 2008 21:05:22 +0000 Subject: [PATCH] polish --- .../webflow/samples/booking/Booking.java | 12 ++++++------ .../webflow/samples/booking/Booking.java | 11 ++++++----- .../webflow/mvc/view/AbstractMvcView.java | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java index 8dbdaef2..7536cfb3 100755 --- a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java +++ b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/Booking.java @@ -17,6 +17,7 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; import org.springframework.binding.message.MessageBuilder; +import org.springframework.binding.message.MessageContext; import org.springframework.binding.validation.ValidationContext; /** @@ -190,14 +191,13 @@ public class Booking implements Serializable { } public void validateEnterBookingDetails(ValidationContext context) { - context.getUserEvent(); + MessageContext messages = context.getMessageContext(); if (checkinDate.before(today())) { - context.getMessageContext().addMessage( - new MessageBuilder().error().source("checkinDate").code("booking.checkinDate.beforeToday").build()); + messages.addMessage(new MessageBuilder().error().source("checkinDate").code( + "booking.checkinDate.beforeToday").build()); } else if (checkoutDate.before(checkinDate)) { - context.getMessageContext().addMessage( - new MessageBuilder().error().source("checkoutDate").code("booking.checkoutDate.beforeCheckinDate") - .build()); + messages.addMessage(new MessageBuilder().error().source("checkoutDate").code( + "booking.checkoutDate.beforeCheckinDate").build()); } } diff --git a/spring-webflow-samples/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java b/spring-webflow-samples/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java index 30e3fe83..ecc1db34 100755 --- a/spring-webflow-samples/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java +++ b/spring-webflow-samples/booking-mvc/src/main/java/org/springframework/webflow/samples/booking/Booking.java @@ -18,6 +18,7 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; import org.springframework.binding.message.MessageBuilder; +import org.springframework.binding.message.MessageContext; import org.springframework.binding.validation.ValidationContext; /** @@ -189,13 +190,13 @@ public class Booking implements Serializable { } public void validateEnterBookingDetails(ValidationContext context) { + MessageContext messages = context.getMessageContext(); if (checkinDate.before(today())) { - context.getMessageContext().addMessage( - new MessageBuilder().error().source("checkinDate").code("booking.checkinDate.beforeToday").build()); + messages.addMessage(new MessageBuilder().error().source("checkinDate").code( + "booking.checkinDate.beforeToday").build()); } else if (checkoutDate.before(checkinDate)) { - context.getMessageContext().addMessage( - new MessageBuilder().error().source("checkoutDate").code("booking.checkoutDate.beforeCheckinDate") - .build()); + messages.addMessage(new MessageBuilder().error().source("checkoutDate").code( + "booking.checkoutDate.beforeCheckinDate").build()); } } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java index 2e473dd9..4b063659 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java @@ -113,7 +113,7 @@ public abstract class AbstractMvcView implements View { /** * Sets the configuration describing how this view should bind to its model to access data for rendering. - * @param binderModel the model binder configuratio + * @param binderConfiguration the model binder configuration */ public void setBinderConfiguration(BinderConfiguration binderConfiguration) { this.binderConfiguration = binderConfiguration;