what is "dynamic" form bean ?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
it says "the name of every control must be defined in the form's bean which may be a Java ActionForm bean or a dynamic form bean defined in form-beans of struts-config.xml)
1. What's "dynamic" form bean ? As far as I know, given a JSP page you should have a corresponding form-bean, right ? Does "dynamic" form bean map to a specific JSP page or what ?
2. Sometimes we need to create some other java beans which do NOT map to any JSP pages' form. They are just some customized java beans for business purpose. Do I need to define such beans in the "form-beans" ??
Thanks.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
http://struts.apache.org/userGuide/building_controller.html
(See secion 4.3.1, DynaActionForm Classes)
2. You do not need to define other model beans in struts-config.xml. Only ActionForm beans and Action classes need to be defined there. Even if you have other beans embedded in your ActionForm, Struts finds these by reflection, and does not require you to define them in the config file.
Merrill
Consultant, Sima Solutions
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Merrill Higginson:
[QB]1. A "Dynamic Form Bean" means using the Struts DynaActionForm or DynaValidatorForm class as your form bean instead of writing one. When you do this, you specify the properties of the bean in the struts-config.xml file.
So, basically I can always use DynaActionForm whenever I need an ActionForm ? And this means I save time in creating those ActionForm classes ? And it means I will NOT have any Form Bean java classes at all ?
Sounds too good!
But just wondering ---
1. Does the container automatically create a DynaActionForm instance everytime ?
2. In Action class we usually do
**********************
public ActionForward execute(mapping, form, request, response) {
SubmitForm f = (SubmitForm)form;
....
*****************
If I use DynaActionForm, should I write
**************
DynaActionForm f = (DynaActionForm)form;
**************
instead ?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
For more about ActionForms and DynaActionForms u can refer http://www.struts.apache.org
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
| When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |






