File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes efficiency of struts validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "efficiency of struts validation" Watch "efficiency of struts validation" New topic
Author

efficiency of struts validation

Sudarshan Sreenivasan
Ranch Hand

Joined: Jun 28, 2007
Posts: 188

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 29249
    
139

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: efficiency of struts validation
 
Similar Threads
validation on serverside
why client side and server side validations?
Why validation at struts ?
Client side validation using Spring MVC
client side validation vs server side validation