Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server Side validation and client side validation

 
nthanigai kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Any one can tell me what is the difference between server side validation
and client side validation

and give some examples of using j2ee

thanks,
 
Sarath Mohan
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Severside Validation means validating the user entered fields after we submitting the request to the server. Server will check the fields for validity from the request and send appropriate message thru the response. Here one request-response cycle is happening.

On the other hand Client side validation does not involve any request submission to the server. Before submission itself validation done thru the script normally Java Script. Here the advantage is that request is not submitted and we save network traffic.

Sarath
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here the advantage is that request is not submitted and we save network traffic.


But it is important to note that eventually the request will be submitted and then, regardless of whether client-side validation was used or not, the values must be subjected to server-side validation.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Client-side validation:

- faster, but not reliable
- You can have it

Server-side validation:

- comparatively slow, but reliable
- You must have it
 
H Wilson
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adeel Ansari:
Client-side validation:

- faster, but not reliable
- You can have it



I would just like to append this bit on client-side validation. Yes, client-side validation is faster in that it gives the user immeditate feedback without submitting a request to the server and then waiting for the response. However, the headaches of cross-platform JavaScript are sometimes just not worth it!
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this topic comes up enough that it should be included in the FAQ. Is it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic