• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

client side validation vs server side validation

 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic