Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is Name attribute requried for Action element

 
Parameswaran Thangavel
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???
 
Dom Lassy
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="".
 
Merrill Higginson
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic