Spring MVC Form Validation Tutorial (With Annotations and ResourceBundle)

In our previous Spring MVC Validation with annotation tutorial we have learnt how to use JSR303 Bean Validation to validate our Spring MVC Forms. There you could see the validation messages are added on the bean constraints itself @NotEmpty(message=“FirstName cannot be empty”) but that is not the way we code in the real world situation. Messages will be added to a property file separately so that we don’t have to restart the server every time when we modify the validation message or when we add a new message. Let’s see how to do validation with ResourceBundle. [Read more…]