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 Architect Certification (SCEA/OCMJEA) and the fly likes JSF Doubts 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 » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "JSF Doubts" Watch "JSF Doubts" New topic
Forums: JSF Architect Certification (SCEA/OCMJEA)
Author

JSF Doubts

guru prasanth
Ranch Hand

Joined: Aug 20, 2009
Posts: 96
In JSF can i write a cusomt validator for validating the business rules.Similarly i need to convert the ui components into
an xml or in to a java object.Can i use a custom convertors.Or should i use backing bean for both validation and conversion.
I know i can use both but which is better according to JSF Best practise.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

None of the above.

Validators and Converters are used by the JSF Controllers as extensions to the Controller function. They shouldn't be handling business rules or conversions other that JSF-internal to/from HTML (text) form. The purpose of a Controller is to represent changes made to a Model in its corresponding View and to reflect changes made to the controls in the View back into the model.

Generally, the process of doing advanced business rule processing and conversion to/from data formats other than those directly addressed by the JSF MVC subsystem is something you handle in an Action method (or AJAX listener).


Customer surveys are for companies who didn't pay proper attention to begin with.
Bharath Kannan
Greenhorn

Joined: Aug 04, 2013
Posts: 2
@Tim,

Can you please help me understand why the ManagedBeans are implementing Serializable?
There are arguments about the bean objects being used over network RMI/RPC, but im not really convinced.

Can you please help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF Doubts
 
Similar Threads
using validations in JSF
how to access values in session from javascript
Q for Hans Bergsten : JSF & Struts integration
Validation for included forms.
spring validation framework