Category Archives: Validations

Server side and client side Validatons

Server side and client side validations..

This was asked to me in one of the java forums. I am also providing it here so that everyone can have a look. 

Client Side Validations 
Its quick… its fast… but it has its own limitations… 
If you have implemented client side validations… I can easily see the source of the page and can easily crack your logic if it has some loop holes… The best example I can give you is the javaScript which was very popular used to watch pics of locked albums in orkut.

Or I may disable the scripts in my browser and yes it is also true that all browsers do not support scripting… so at that time the code written for the validation is nullified. A user can enter any thing he wants and can produce some internal application error… or can corrupt ur database. 

Just think that what can spammers do if the image verification is validated at the client side… 

Now lets go to server side validations….

Server Side Validations 
Slow…. takes time… but are reliable…. a user can access my web application from PDA or any browser… It may or may not support scripting…. I am safe as the logic resides in my server… So i get protection against spammers, logical errors, application errors which can come due to inconsistent data.. 

On the other hand it is more easier to write validations in any Programming language and to maintain it. It takes lesser time. 

Hope this will give you a better understanding of what the reality is in todays unsafe world.

Leave a comment

Posted by on May 13, 2009 in JSF, Validations