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 why bother with struts HTML tags? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "why bother with struts HTML tags?" Watch "why bother with struts HTML tags?" New topic
Author

why bother with struts HTML tags?

Andles Jurgen
Ranch Hand

Joined: Mar 18, 2002
Posts: 67
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

Joined: Feb 20, 2002
Posts: 350
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 is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
Rick Hightower
Author
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
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

Joined: Mar 18, 2002
Posts: 67
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why bother with struts HTML tags?
 
Similar Threads
Information lost on error.
URGENT ! Trouble using CHECKBOX
adding Dynamic text boxes using struts
html select onchange
Struts2 - jquery Plugin - Fieldset