• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Customized error messages for validateLength

 
Greenhorn
Posts: 8
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I display a customized error message for the <f:validateLength>?

<h:inputText id="nameField" value="#{Test.name}">
<f:validateLength minimum="2" maximum="6"/>
<h:message for="nameField"/>
</h:inputText>

The error message that is displayed is "testForm:nameField: Validation Error: Value is greater than allowable maximum of '6'".

Is there any way I can change the error message being displayed?
[ November 08, 2008: Message edited by: Rishidharan Somu ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make your own messages.properties file, and register it in your faces-config.xml using the <message-bundle> tag. For the properties files, you'll find the full list of messages keys in the JSF specification, 2.5.2.4 Localized Application Messages.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic