| Author |
How the validation is done in JSF?
|
Adi Wanik
Greenhorn
Joined: Feb 15, 2011
Posts: 7
|
|
Hi Guys..
can anybody explain me how the validation is achieved in JSF??
i am having one input field of time management, and when i enter invalid junk characters, then i get errors..And i want to know where exactly the validation takes place??
please guide me.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56215
|
|
|
"Adi dont know", please check your private messages for an important administrative matter. Thanks.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Adi Wanik
Greenhorn
Joined: Feb 15, 2011
Posts: 7
|
|
Hi Guys..
can anybody explain me how the validation is achieved in JSF??
i am having one input field of time management, and when i enter invalid junk characters, then i get errors..And i want to know where exactly the validation takes place??
please guide me
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
Thanks for fixing your display name, Adi. Here's some info that may help.
Validation is a standard phase in the JSF request/response lifecycle. At Validation time, the data which was in the submitted input controls is presented to the validators, which make up part of the Controller framework of JSF's MVC atchitecture.
Validators come in 2 varieties: built-in and user-defined. The built-in ones are supported by their own JSF tags, such as <f:validateLongRange>. User-defined validators are normally defined to be used with the general-purpose validation tag.
In either event, the core functionality is a validate() method that returns void when the data is OK. When the function determines that the data is not valid, it throws a ValidationException and the error message set as the Exception message text.
JSF's master Controller (FacesServlet) will then catch the exception, push the error message into the request's FacesContext messages object, and then proceed. Since it has detected a validation error, it will skip the phases of the JSF lifecycle that can only be done if the data is valid, such as the Update Data and fire Action phases.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: How the validation is done in JSF?
|
|
|