ralscha/extdirectspring — pull request #116 by dilbertside (2013-11-08 11:41:54+00:00)
Title: Change request proposal to resolve message codes for validation fields error form post result 

Hi,

I'm using additional information on rather stern validation error messages along what Spring proposed under
http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/htmlsingle/#validation-conversion

The change I propose let me define such error messages
javax.validation.constraints.NotNull.message.ph=Valid Phone number must be set
javax.validation.constraints.NotNull.message.fax=Valid Fax number must be set

in a message resource bundle (in my case specific to validation).

Your implementation prevent to get javax.validation.constraints.NotNull.message.fax as the last one is always javax.validation.constraints.NotNull.message, the default one

I propose to iterate codes so to get the ones built by DefaultMessageCodesResolver cf http://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/validation/DefaultMessageCodesResolver.html

I propose a new method because it has an overhead due to the additional iteration and logic which may slow down a bit applications who do not care of customized validation messages.

It works in my environemt.
Please advise where should I add some unit test.

Regards