Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

is Name attribute requried for Action element

 
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi Merrill
You r right i am using html:form so in this case, name is mandatory.
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic