*
The moose likes JSF and the fly likes JSF - Client Side validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF - Client Side validation" Watch "JSF - Client Side validation" New topic
Author

JSF - Client Side validation

dwarakanathan thiru
Ranch Hand

Joined: Oct 14, 2009
Posts: 49
Hi All,
Can any one please tell me how to perform a client side validation in JSF.
Please let me know the different options of client side validation in JSF.

In Struts we have a validation framework, likewise do we have any in JSF?
How about simple java script?

Thanks in advance!!


Thanks,
Dwarak T
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

The basic JSF tagset doesn't support client-side validation, only server-side validation. You can do your own client-side validation using JavaScript in the usual way, since the JSF controls all support the same attributes as their underlying HTML controls, including "onchange", "onblur" and so forth.

It's perfectly possible to create a JSF tagset that automatically generates this javascript as part of the HTML rendering, but I don't know of any tagsets that do that at the moment.

Just remember that client-side validation isn't sufficient to protect the app. You also need server-side validation if you want to avoid problems due to people hacking or because of errors in the client-side validation code.


Customer surveys are for companies who didn't pay proper attention to begin with.
dwarakanathan thiru
Ranch Hand

Joined: Oct 14, 2009
Posts: 49
Cool!! That was informative. I am going to use the simple javascript in client side and server side.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF - Client Side validation
 
Similar Threads
Client side validation in JSF 2.0?
Regarding Form Validation using Validator plugin
Using JQuery JSF components together
client side validation through the Struts frame work
Client side validation in JSF