• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

client side validation vs server side validation

Ranch Hand
Posts: 174
  • 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
Ranch Hand
Posts: 4864
  • 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.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic