aspose file tools*
The moose likes Struts and the fly likes struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts" Watch "struts" New topic
Author

struts

ambarish reddy
Greenhorn

Joined: Jun 22, 2007
Posts: 2
Hi,

any one please answer this one.

In struts framework, is there any disadvantages using dyna validator form and dyna action forms?

[ June 22, 2007: Message edited by: ambarish reddy ]
[ June 22, 2007: Message edited by: ambarish reddy ]
Merrill Higginson
Ranch Hand

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

instead of


- 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.


Merrill
Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
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.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts