Wednesday, March 3, 2010

Struts ActionForm & DynaActionForm

Difference between ActionForm and DynaActionForm


An ActionForm represents an HTML form that the user interacts with over one or more pages. You will provide properties to hold the state of the form with getters and setters to access them. Whereas, using DynaActionForm there is no need of providing properties to hold the state. Instead these properties and their type are declared in the struts-config.xml

The DynaActionForm bloats up the Struts config file with the xml based definition. This gets annoying as the Struts Config file grow larger.

The DynaActionForm is not strongly typed as the ActionForm. This means there is no compile time checking for the form fields. Detecting them at runtime is painful and makes you go through redeployment.

ActionForm can be cleanly organized in packages as against the flat organization in the Struts Config file.

ActionForm were designed to act as a Firewall between HTTP and the Action classes, i.e. isolate and encapsulate the HTTP request parameters from direct use in Actions. With DynaActionForm, the property access is no different than using request.getParameter( .. ).

DynaActionForm construction at runtime requires a lot of Java Reflection (Introspection) machinery that can be avoided.

2 comments:

.net Obfuscator,  September 28, 2011 at 2:23 AM  

A .NET component can be written partially in VB.NET and C# whichever pleases to the programmer. The larger application can also be mix of languages that will give a combined effect to the whole program or application. 

<span> </span>.net Obfuscator

Blog Widget by LinkWithin

JS-Kit Comments

  © Blogger template Newspaper III by Ourblogtemplates.com 2008

Back to TOP