• 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

jsf validation example

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I was running JSF validation example from the link

http://www.exadel.com/tutorial/jsf/jsftutorial-validation.html


I was not able to unserstand from where and how the error message got printed when you click the button by givin input text length less than 2 or greater than 10. Any ideas, links, sample code, resources highly appreciated. thanks in advance
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Error messages will be displayed where you have written the following command. This tag will show all messages for the components

<h:messages style="color:darkred"/>
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was not able to understand from where the text of the error message coming. I checked facess config as well as mesages files. None of them has the text. Does the it is showing default text message. If that is the case where can i find all those default text messages. Please advise
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The range validation error message template is contained within the validator's own source code, although you can provide overrides.

In the case of that particular error, the validator does a message Format operation to create a message from the template with the range constraints plugged in, then throws a ValidationException where the Exception message text is the message that was just created. The JSF framework catches it and adds it to the messages container and the JSF message elements select it and format it for display.
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>>>>The range validation error message template is contained within the validator's own source code,

where and how can i see all those messages within the validator's own source code
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could download the source code and look through it. Perhaps you could explain why you need to see the source code? There may be an easier solution to whatever you are trying to do.
 
reply
    Bookmark Topic Watch Topic
  • New Topic