• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why bother with struts HTML tags?

 
Andles Jurgen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use the struts html tags, you have to make that page a jsp - as opposed to a form page being just standard HTML. What is the main reason you do <html:form> for example, over <form>.
I am reading the o'reilly struts book and it does not seem to provide any reason to use the struts html tags at all, apart from a comment alluding to "tighter integration" - no explanation.
All my struts stuff so far just uses standard html forms when possible, am I missing out out on something here?
Andles.
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
html:form looks up the ActionForm associated with the mapping. If the ActionForm is in scope (session or request settable in the action mapping), then the form will be populated with the values from the ActionForm.
 
Rick Hightower
Author
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also since the html:form is associated with the ActionForm it will make sure that hte properties you use are members of the ActionForm, e.g., html:text property="foo" will fail unless the ActionForm in scope has a property called foo (form.getFoo()).
 
Andles Jurgen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response Rick.
re:
it will make sure that hte properties you use are members of the ActionForm
Not sure what the gain is here - my form fields were properties accessible in the action form anyway. Am I misunderstanding something?
Also, while I have you, did you read my post about the html:base tag and named anchors - reallly struggling with that one.
Andy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic