what is diffrence between Dynaactionform,actionform and
Dynavalidateform
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
what are tiles in struts?
what is a RequestProcessor?
what is the diff between struts1.0 and struts2.0
What is the purpose of @action annotation?
What is interceptor struts2?
where you use thread in your java project?
How Struts will follow the MVC?
Do we need to pay the struts if being used in commercial purpose?
How is a lookup dispatch action created?
What are the differences between http direct and http indirect?
How do I access token?
What does action do in struts?