Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:javascript question

 
Tony Smith
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic