"Deadman, Hal" wrote:
Shouldn't these two tags be equivalent:<bean:struts id="officeForm" formBean="officeForm"/><jsp:useBean id="officeForm" scope="request" class="com.tallan.odtos.web.form.OfficeForm" />
when the following is defined in struts-config.xml:<form-beans>
<form-bean name="officeForm" type="com.tallan.odtos.web.form.OfficeForm"/>
</form-beans>When I use the bean:struts tag to declare a scripting variable, the officeForm variable gets created with a type of ActionFormBean instead of the type that I specified in my struts-config.xml. Using a jsp:useBean tag works but it seems like bean:struts should work too and it doesn't work for me.Is that a bug or am I doing something wrong? Thanks, Hal


No, the two calls should do something different.  The <bean:struts> tag is used to expose Struts configuration objects themselves.

As the documentation says, <bean:struts id="officeForm" formBean="officeForm"/> is supposed to return the form bean *definition* object -- in other words, the ActionFormBean instance that represents the contents of the <form-bean> element from struts-config.xml.  In Struts, this is an object of type ActionFormBean.

Similarly, using <bean:struts id="foo" mapping="/saveCustomer"/> will look up and return an ActionMapping object representing the XML element <action path="/saveCustomer" .../> in your struts-config.xml file.

There is no current tag that will dynamically instantiate an instance of the ActionForm class associated with an ActionFormBean, although I suppose such a tag could be created if it were generally useful.

Craig McClanahan
 

Reply via email to