Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

struts form bean

 
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic