Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF validation

 
Maciej Kaweski
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I use hibernate validator 4.0.2-GA (implementation of JSR 303) to validate my input fields. All works fine, but it always displays the message with the client id:

typeForm:title: Bitte einen Titel zwischen 6 und 128 Zeichen eingeben.

I want to get rid of this client id. Only the error message should be displayed:

Bitte einen Titel zwischen 6 und 128 Zeichen eingeben.

How can I do this?

Thanks a lot!
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18163
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Maciej!

You can replace the validation message text on a generic basis for the entire webapp by defining and registering an alternate set of message text properties to JSF. However, since JSF 2 (or maybe 1.2), you can also define a message that's customized for just the control that you are already using. The attribute name is, I believe "validationMessage".
 
Maciej Kaweski
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I already use the ValidationMessages property. I located the bug/fearure in MyFaces. It always prepends the label of the UInput, and if it is not defined, it prepends the ID. I didn't find a way to turn it off. I switched to Mojarra and everything is working fine now.
But if you know how to turn this behaviour off in MyFaces, please let me know.

Regards
Joschi
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18163
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I has been a long time, but I think there actually is something for that.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic