• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

is Name attribute requried for Action element

 
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
i am working in a struts proj. When i tried to map a url to a action which doesn't need bean, i didn't gave the name attribute...

But by doing so i get the below error.....

Cannot retrieve definition for form bean

why its so, on giving the name attribute pointing to someother form bean,
struts framework doesn't throw any error why its so???
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you omit name altogether or do you do name=""?

I think you will have a problem if you do name="".
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is definitely OK to leave out the name attribute when defining an action. I do this all the time, and don't get the error you mentioned.

Could you show us more of your code? One thing you should be aware of is that it is not ok to leave out the name attribute if you use the action in an <html:form> tag. In this case it is mandatory.
 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Merrill
You r right i am using html:form so in this case, name is mandatory.
 
reply
    Bookmark Topic Watch Topic
  • New Topic