my dog learned polymorphism*
The moose likes JSP and the fly likes Server Side validation and client side validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Server Side validation and client side validation" Watch "Server Side validation and client side validation" New topic
Author

Server Side validation and client side validation

nthanigai kumar
Greenhorn

Joined: Dec 13, 2004
Posts: 5
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

Joined: Mar 17, 2001
Posts: 213
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


Sarath Mohan
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
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

Joined: Feb 23, 2005
Posts: 33
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

Joined: Feb 20, 2001
Posts: 580
I think this topic comes up enough that it should be included in the FAQ. Is it?


James Carman, President<br />Carman Consulting, Inc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server Side validation and client side validation
 
Similar Threads
How to validate time field using validator framework of struts
what happens if i diable javascript in my browser?
date validation
Validation in Spring
validating forms