aspose file tools*
The moose likes Struts and the fly likes html:javascript  question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:javascript  question" Watch "html:javascript  question" New topic
Author

html:javascript question

Tony Smith
Ranch Hand

Joined: Jul 07, 2007
Posts: 229
I guess there is <html:javascript /> tag that can be recognized by the struts. My question is, why would you use the tag if you are already using validator framework or override the validate method? Also is javascript necessary for struts if you are just using it for field validation?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The <html:javascript /> tag is needed if you want the validation framework to provide client-side validation. Since the validation framework always provides server-side validation, you don't really need client-side validation, but it may be desirable. It's more efficient to catch certain errors client-side without having to make a round-trip to the server. However, because the user can turn off javaScript in the browser, you can't rely solely on client-side validation. You still need to re-check everything on the server side.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: html:javascript question