aspose file tools*
The moose likes JSF and the fly likes Customizing  validations-h:message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Customizing  validations-h:message" Watch "Customizing  validations-h:message" New topic
Author

Customizing validations-h:message

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
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

Joined: Feb 05, 2001
Posts: 17249
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
The following link will be helpful


Custom Error Messages


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Customizing validations-h:message
 
Similar Threads
<h:message /> Error message with JSF Code
prevent auto submit
Customizing &gt;h:message&lt;
message required
display error message