Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Customizing validations-h:message

 
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
 
ranger
Posts: 17344
11
Mac IntelliJ IDE 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
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following link will be helpful


Custom Error Messages
 
I think she's lovely. It's this tiny ad that called her crazy:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!