aspose file tools*
The moose likes Struts and the fly likes  client side validation  vs  server side  validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " client side validation  vs  server side  validation" Watch " client side validation  vs  server side  validation" New topic
Author

client side validation vs server side validation

rehans oberoi
Ranch Hand

Joined: Dec 06, 2005
Posts: 174
hi , i am new to the struts .
struts provide both client side and server side validation
which is better . what is the need of struts client side validation . we can have javascript validation
thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The term "client-side validation" refers to JavaScript code automatically generated by Struts and placed in your JSP to validate data before a submit occurrs. If validation is turned on, Struts always does server-side validation whether you do client-side validatoin or not. In order to use the Struts Validation Framework's client-side validation, you will still have to modify each JSP to plug into the generated validation scripts.

The advantages of client-side validation are that it's faster and that it saves sending a request to the server that is doomed to be rejected anyway.

The disadvantage of client-side validation is that it's not 100% reliable due to the fact that users can turn off JavaScript in their browsers. If they do this, none of the JavaScript code runs at all. That's why Struts always does server-side validation just in case.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: client side validation vs server side validation