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

efficiency of struts validation

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
The struts validation causes a server hit even for validation that can be done on the client end , is'nt this going to prove too costly for most applications ?

Even the so called client side validation reaches upto the controller which is essentially a server side component , so according to me it is also not of much help !

Please can some one throw some light on this aspect

Thanks in advance
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sid,
Struts provides an option to do both client (JavaScript) and server (Java.) It generates JavaScript to validate all the form fields in the browser when the user clicks submit. If you have this option set, the server validation would just run if the user turns off JavaScript.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One further point: Struts 1 client-side validation does not make any calls to the server while validating. It is all set up before the page is rendered in JavaScript functions. When the user actually clicks the submit button, the client-side validations are all handled via local JavaScript calls that do not access the server.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic