Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Customizing validations-h:message

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my JSF page i have

whenever i submit the page without entering a value for FirstName i get

"FirstName": Value is required

I am hoping to change the message outputted by this h:message , please how do i accomplish this
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each error message like that has a corresponding "name" that you can put into a messages.properties file, and they can also be internationalized with message_en.properties or messages_fr.properties.

I just forget the exact "name" to use it is something along the lines of

javax.jsf.required=My New {0} Message

I know they are on the internet and on my laptop, I actually have a bookmark on a page that has them all, but I am not on my laptop, so I am sorry I cannot give that link, but you can find it through a Google search.

Good Luck, and I hope at least I showed you were to look and what to look for.

Thanks

Mark
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following link will be helpful


Custom Error Messages
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic