JSF can validate the input values. Can anybody say where JSF validates..?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think both answers are a bit unclear, therefore I would like to summarize:
1.) JSF as it is, always performs the validation on server side! Validation in JSF is a part of JSF component lifecycle. The life-cycle is triggered when you submit some data. I do not want to go in details but the life-cycle goes through the phsaes (Restore the component, trigger conversions, validate the converted values, execute actionlisteners and actions, render the reponse)
2.) The validation that feels like client-site validation is when you use ajax support in JSF. What this method does is that it requests the execution of only some html fields. JSF performs the same life-cycle as for the ordinary requests. The difference is that it converts and validates only the components you specify, and renders the output only for components you specified. Therefore, ajax supported validation in JSF is also preformed on the server-side!
3.) I have to disagree that third-party libraries provide client-side validation.
Primefaces integrates jQuery UI, but it still uses the ajax aproach to validate data. You can write your own jQuery JS to validate certain field, but I would not do it. It is painful to write and hard to manage duplicated validation logic.
Richfaces provides partial client-side validation. It provides JS implementation for some of the JSR 303 and JSF validators. Therefore, real client-side JS validation is provided, but only for the validators for which JS implementation exists. See: http://planet.jboss.org/post/richfaces_4_client_side_validation
Ice faces as being a Primefaces clone do not provide client-side validation.