This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Displaying custom messages in JSF

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using jsf validation and the issue is, when i used required attribute for the jsf component the default message(Validation Error: Value is required)is getting displayed, instead of this message i need to display my own custom message, to overcome this I have taken one propertie file and
added the below line, and added the property file in faces config file,

javax.faces.component.UIInput.REQUIRED = Entry is required.

and this is working fine,

But here the problem is, i need to display the message,
forexmp: For user text box --->Message is ---> User Entry is required
For Password Password Entry is required
For designation Designation Entry is reuired

in the same way for the other fields,

Is there any solution for this issue.

Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well at first you will put an :

<h:message styleClass="validationMessages" for="tipPersoanaRadio" />

tag where you would like the message to appear , configure a validator in faces-config.xml ,and then write a validator class which will set the summary of the message like this :

where my ValidatorMessageUtil is something like :

Have fun ,
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic