From 5024452160b1f5f216424008c4c00b72f006ea15 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Wed, 24 Sep 2008 21:10:14 +0000 Subject: [PATCH] generated messages --- spring-webflow-reference/src/views.xml | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/spring-webflow-reference/src/views.xml b/spring-webflow-reference/src/views.xml index bdf5c0ea..60544b63 100644 --- a/spring-webflow-reference/src/views.xml +++ b/spring-webflow-reference/src/views.xml @@ -548,6 +548,39 @@ reservationConfirmation=We have processed your reservation - thank you and enjoy ]]> + + Understanding system generated messages + + There are several places where Web Flow itself will generate messages to display to the user. + One important place this occurs is during view-to-model data binding. + When a binding error occurs, such as a type conversion error, Web Flow will map that error to a message retrieved from your resource bundle automatically. + To lookup the message to display, Web Flow tries resource keys that contain the binding error code and target property name. + + + As an example, consider a binding to a checkinDate property of a Booking object. + Suppose the user typed in a alphabetic string. + In this case, a type conversion error will be raised. + Web Flow will map the 'typeMismatch' error code to a message by first querying your resource bundle for a message with the following key: + + +booking.checkinDate.typeMismatch + + + The first part of the key is the model class's short name. The second part of the key is the property name. + The third part is the error code. This allows for the lookup of a unique message to display to the user + when a type conversion failure occurs on a Booking checkinDate binding. Such a message might say: + + +booking.checkinDate.typeMismatch=The check in date must be in the format yyyy-mm-dd. + + + If no such resource key can be found of that form, a more generic key will be tried. + This key is simply the error code. The field name of the property is provided as a message argument. + + +typeMismatch=The {0} field is of the wrong type. + + Displaying popups