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 the purpose of @before?

0 Answers  


Why was reload removed from struts (since 1.1)?

0 Answers  


How is the mvc design pattern used in struts framework?

0 Answers  


How can we work with error tags?

0 Answers  


What is role of actionservlet?

0 Answers  






What is the purpose of @stringlengthfieldvalidator annotation?

0 Answers  


how handle when client send multiple request at atime for multiple servlets servlets?

3 Answers   IBM,


What is spring and struts in java?

0 Answers  


What is the difference between Jakarta Struts and Apache Struts? Which one is better to use?

0 Answers  


What do you mean by the abstract package in struts2, and what is its utilization?

0 Answers  


we have two applications A1 & A2 both are accesing the same databse table employee at the same time how we will manage this so that both application can get the correct no of emloyee while A1 is inserting a employee at the same time while other applicatuion is getting the empployee list.

5 Answers   Accel, TCS,


How is token generated?

0 Answers  


Categories