I personally don't like DynaActionForm and seldom use it except for "demo" type applications. The main things I don't like are:
- It's more verbose and more awkward to retrieve the value. You have to write:
- If you misspell something, the compiler doesn't catch it. In the above example, if I write dynaForm.get("customerNmae") the compiler won't correct me and I won't find out it's wrong until run time. If I write myForm.getCustomerNmae() the compiler will correct me.
- you have more flexibility with a regular ActionForm. If you want to do something fancy in a getter that will manipulate the format of the property, you can.
Furthermore, if you're using a good IDE such as Eclipse or NetBeans, writing an ActionForm is at least as easy as writing the XML to define DynaActionForm properties in the struts-config.xml file. All you have to do is define the properties and invoke the tool to create getters and setters.
Ditto what Merrill said. I get annoyed by the "define it in xml and then you don't have to write any code" mentality...you still have to write code but now it is in xml and you get no help from your IDE or compiler.