what is diffrence between Dynaactionform,actionform and
Dynavalidateform

Answers were Sorted based on User's Feedback



what is diffrence between Dynaactionform,actionform and Dynavalidateform..

Answer / mohd. irfan khan

All three are javaBean Class that can maintain the session
state for web application. The ActionForm object is
automatically populated on the server side with data
entered from a form on the client side.
An ActionForm/DynaValidateForm can have getter(),Setter(),
reset() and the validate() methods that can be defined in
your actionForm or in Action class itself. If any changes
are made to the properties, code need to be recompiled.

Her comes the DynaActionForm to rescue. It allows
properites to be specified in Struts-cofig.xml file there
by avoiding the recompilation of the code.Also there is no
need to have a Form Bean for every page that had getter and
setter method for each of the field on the page.

This is how it can be declared in struts config file:
<form-beans>
<form-bean name="employeeForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="fname" type="java.lang.String"/>
</form-bean>
</form-beans>

Is This Answer Correct ?    25 Yes 5 No

what is diffrence between Dynaactionform,actionform and Dynavalidateform..

Answer / jane priscilla

All three are javaBean Class that can maintain the session
state for web application and the ActionForm object is
automatically populated on the server side with data
entered from a form on the client side. but an
--->ActionForm(DynaValidateForm) can have getters(),Setters
(),reset() and the validator() methods.

--->DynaActionForm should be given in Struts-cofig.xml as
follows
<form-beans>
<form-bean name="employeeForm"
type="org.apache.struts.validator.DynaValidatorForm"
<form-property name="dispatch" type="java.lang.String"/>
</form-bean>
</form-beans>

Is This Answer Correct ?    21 Yes 4 No

what is diffrence between Dynaactionform,actionform and Dynavalidateform..

Answer / ramkiran

In case of the ActionForm user has to write the setters and
getters for every jsp page(request).supoose we have 10
jsps then we have to write10 Action Forms.Dyna Action is a
Generic action form which represents a form.

In DynaActionForm :properties of the form are decided at
the time of deplying the application.

DynaActionForm eliminates this burden and creates the form
bean itself. This way we don't have to write setters and
getters...infact we don't have to give any bean class. To
use DynaAction Form, we have to declare the form bean as a
DynaActionForm Type in struts-config.xml. You will have to
declare the properties and their type too.

Is This Answer Correct ?    7 Yes 2 No

what is diffrence between Dynaactionform,actionform and Dynavalidateform..

Answer / madhukiran

ActionForm will populate the properties depending on the
respective JSP fields.In this we can specify the validate()
method (if required) for validations or else you can use
ActionErrors for validating..

DynaActionForm has to be defined in Struts-config.xml and
it may have many property fields. We can use this form for
many no.of JSPs.Single dynaActionForm can serve for many
number of JSPs.

DyanValidateForm is same as DynaActionForm but we no need
to specify explicitly for the Validations. If we define a
DynaActionForm as DynaValidateForm, then it will look up of
rthe validations.

One more is there DynaValidatorActionForm which will allow
you to specify the path variable of <action> tag in
Validator.xml where as in DynaValidateForm will take
formname.

Is This Answer Correct ?    6 Yes 1 No

what is diffrence between Dynaactionform,actionform and Dynavalidateform..

Answer / labourer in an mnc

ActionForm
This class must be subclassed in order to be instantiated.
Subclasses should provide property getter and setter
methods for all of the bean properties they wish to expose,
plus override any of the public or protected methods for
which they wish to provide modified functionality.

DynaActionForm
Specialized subclass of ActionForm that allows the creation
of form beans with dynamic sets of properties, without
requiring the developer to create a Java class for each
type of form bean.

DynaValidatorForm
This class extends DynaActionForm and provides basic field
validation based on an XML file. The key passed into the
validator is the action element's 'name' attribute from the
struts-config.xml which should match the form element's
name attribute in the validation.xml.

Differences
ActionForm does not create getters and setters like we
cannot write <form-bean name="loginForm"
type="org.apache.struts.action.ActionForm"> in struts-
config.xml.

DynaActionForm cannot be used if we want validation in that
case DynaValidatorForm can be used.

Is This Answer Correct ?    5 Yes 1 No

what is diffrence between Dynaactionform,actionform and Dynavalidateform..

Answer / ram-sd softech

These are form beans which simplfy the process of handling
the forms
Form Beans contains
1. instance variables
2. setters
3. getters
4. reset method
5. validate method
For Action Form the all above 5 properties are manditory
For DynaActionForm above 1,2,3 properties are not needed
(here we provide the information in struts-config.xml)
For DynaValidation Form above 4,5properties are not needed

Is This Answer Correct ?    11 Yes 8 No

what is diffrence between Dynaactionform,actionform and Dynavalidateform..

Answer / a.jyotsna

how we can used setter getter reset and validate() in
struts give one Example.plz soon.

Is This Answer Correct ?    2 Yes 1 No

what is diffrence between Dynaactionform,actionform and Dynavalidateform..

Answer / hazarath kumar

Dynaactionform & actionform have getters & setters and
validates.
ActionForm object is automatically populated on the server
side with data.

Is This Answer Correct ?    3 Yes 10 No

Post New Answer

More Struts Interview Questions

what is purpose cvs and vss in eclipse?

2 Answers  


what is the main reason for developing struts? what is advantages over Basic MVC architecture based JAVA Application?

1 Answers  


Which configuration files are used in struts?

0 Answers  


What are the classes used in struts?

0 Answers  


When wil use singleton class in Struts

7 Answers  






what is meant by Struts Validator Framework?

0 Answers   Cap Gemini,


how you implement and maintain your struts project by using MVC2 arch?

2 Answers   Patni, Wipro,


What are result types in struts?

0 Answers  


Explain design patterns which is used in struts?

0 Answers  


How client side validation is enabled on a jsp form?

0 Answers  


what r the disadvantages of MVC-2 Architecture?

2 Answers   Process IT,


Which design pattern is implemented by Struts2 interceptors?

0 Answers  


Categories