aspose file tools*
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 Java 8 in Action this week in the Java 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: 15665
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Process Validator in the backing bean vs in the jsf page
 
Similar Threads
parameter passing to Seam backing bean method
Change Component Style on Validation
How to pass parameters or atributtes to a custom validator
Backing Bean in JSF 1.2
Converter instances