jQuery in Action, 3rd edition
The moose likes JSF and the fly likes Process Validator in the backing bean vs in the jsf page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Process Validator in the backing bean vs in the jsf page" Watch "Process Validator in the backing bean vs in the jsf page" New topic
Author

Process Validator in the backing bean vs in the jsf page

Laurent Wulser
Greenhorn

Joined: May 23, 2011
Posts: 2
In case of custom validator class, is it possible to use it directly in the backing bean, like jsf2 annotation ? Or do we need imperatively to call the validator in the xhtml file with the f:validator ?

I would like to simplify the view. Otherwise, is it possible to create new validator annotation ?

Has someone any example of backing bean like that ?

Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17148
    
  27

I'm a little unclear on what you're hoping to accomplish. JSF validators are run before the backing bean "set" and action methods are invoked, and if validation fails, the "set" and action methods won't be invoked at all.

The virtue of JSF validators is, in fact, that they aren't Java code, but are specifications. Studies have determined that specifications are generally more efficient and safer to use than code - for the simple reason that specifications are inherently limited and therefore can be more rigorously checked and optimized with relatively little overhead.


An IDE is no substitute for an Intelligent Developer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Process Validator in the backing bean vs in the jsf page
 
It's not a secret anymore!