hibernate validator constraints with custom messages

UI Components for JSF
Post Reply
bphalak
Posts: 34
Joined: 28 Jun 2011, 15:12

30 Jun 2011, 14:45

How i can read or replace the hibernate validator constraints annotation messages with my property file messages.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

30 Jun 2011, 15:33

You can write an own MessageInterpolator and register it in the validation.xml via <message-interpolator>yourClass</message-interpolator>. There you can read your own message bundles or from database and return it.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 40 guests