In our application, the implementation for error message handling is: using
a HashMap for error messages with the form propertyName as the key. This
prevents duplicate messages for form fields. Taking one example use-case:
zipCode, rules are: must be numeric, and must be at least 5-digits in
length.

Debated in our group is the need for having both messages presented to the
user if "qwe" were entered for a zip code. Granted, this simple use case may
not be the best example of needing multiple messages. But we feel the
implementation should support it.  Changing the HashMap key to
propertyName+messageName would suffice, but the need for this change is
pending our findings on best-practices. I searched the archives for
"+validation +'per field' " with few results that did not really address
this question.

Reply via email to