Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom messages in Hibernate Validators

Lee Mark
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

following this link i can get the custom messages but from properties file. what if i need same from class i mean

some thing like.. public class Messages_en_US extends ListResourceBundle {

protected Object[][] getContents() {
labelsArray = new Object[labels.size()][2];
int counter = 0;

labelsArray[counter][0] = "key.val";
labelsArray[counter][1] = "value from Db";

labelsArray[++counter][0] = "key";
labelsArray[++counter][1] = "value from Db";
return labelsArray;

Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!