This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes jsf validation example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "jsf validation example" Watch "jsf validation example" New topic
Author

jsf validation example

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
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
Pankaj .k. Jain
Greenhorn

Joined: Dec 03, 2010
Posts: 6
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

Joined: Jun 08, 2009
Posts: 238
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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
>>>>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
John Tannel
Greenhorn

Joined: Dec 17, 2010
Posts: 23
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsf validation example
 
Similar Threads
Why use JSF with AJAX instead of jsp/struts or jsp/Ajax Servlet or php for AJAX apps?
combo box valildations
using validations in JSF
Field validation in session beans?
JSF and AJAX are just opposite