Overriding messages of annotation based validation


I was doing a project and it was almost completed. Now i was asked to implement Internationalization in it and i successfully implemented that. After that i came across a challenge where i have to remove the messages from validation beans in which annotation based validation tags were implemented.

@Size(min = 1, max = 50, message = "Email size should be between 1 and 50")
private String loginId;

 

Read All…

Implementing Internationalization in Spring


Spring provides us a flexible way to hook up internationalization in our framework/application at any time. It can be hook up in spring while loading the context.

Spring provides us two kinds of locale resolvers. Session based and Cookies based.
Session Based stores locale changes in session.
Cookie based stores locale changes in cookies.

You can choose any resolver of your choice and can register it as interceptor while loading the context.

Read All…