File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes is Name attribute requried for Action element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "is Name attribute requried for Action element " Watch "is Name attribute requried for Action element " New topic
Author

is Name attribute requried for Action element

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
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

Joined: May 05, 2006
Posts: 181
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

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
Hi Merrill
You r right i am using html:form so in this case, name is mandatory.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is Name attribute requried for Action element
 
Similar Threads
Struts custom form question.....
Struts 1:in the bean:write tag, can "name" even refer to an attribute name, instead of a bean name ?
Ways of getting [Servlet Error]- [BeanUtils.populate] exception
Struts1.2_ Exception
An ActionForm populated in one Action is not getting its values