Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts form bean

 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

Struts <html:form> tag takes a name and type attribute (form bean name and its complete class name). I want to know what is the significance those two attribute in html:form tag.

Is name and type attribute of <html:form> same as form-bean tag of struts-config.xml. Suppose if I don't specify form-bean tag and just use name and type attribute of html:form for locating form bean class. Will that work?

Thanks in advance

Naseem
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has always been a bit confusing.

The name and type are completely unnecessary, because they are already defined for a given action path in the struts-config.xml file. Once you specify the action, Struts can look up the rest. I'm not even sure what happens if you specify a different name or type than what is defined in the config file. Suffice to say that you shouldn't do it.

In the latest version (1.2.9) these attributes are deprecated, and you are no longer able to enter them. For earlier versions, the best practice is not to enter them.
 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merrill,

I agree with you. It really create confusion. Now I will try 1.2.9 version.

Thanks once again

Regards

Naseem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic