File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

client side validation vs server side validation

 
rehans oberoi
Ranch Hand
Posts: 174
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic