What is the DynaActionForm? How we implement the
dynaactionform ? can u please tell me the way to implement?
in understandable way?

Answers were Sorted based on User's Feedback



What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to i..

Answer / penchala

In struts, every form control need to have one ActionForm
class property and getter/setter method for it.
DynaActionForm will replace the ActionForm with the simple
xml mappings so that the java form class can be eliminated
and thus helps in developing the application more quickly.
The advantages of using the DynaActionForm are as follows:-


1. No ActionForm is required.

2. Replace the property mapping with the simple xml file so
that if any property is to add and remove then there is no
need to compile the java class again.


The mapping is to be done in the struts-config.xml file in
the <form-bean> tag for all the form properties.

<form-bean name="inputForm"
type="org.apache.struts.action.DynaActionForm" >
<form-property name="name" type="java.lang.String"/>
<form-property name="email" type="java.lang.String" />
</form-bean>

Is This Answer Correct ?    19 Yes 1 No

What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to i..

Answer / prapanch

this is to tell you in an easily understandable
way.actuallyl in struts when you enter some data in jsp's
you will declare one action form which will act like a
javabean having settes and getters for all the fields in
the jsp. from the object of the action form you can later
retrieve the data enterd by the user.

but here dynaactionform is a smart way to escape coding all
the setters and getters.you can configure the struts-
configfile so that for each and every field in your jsp one
field property will be there in the struts config file.

it will be like this for example your form has username and
password then you need to configure your config file like

<form-beans>
<form-bean name="name of the form" path="fully qualified
name for the class of the form">
<form-property name="username" type="java.lang.String"/>
<form-property name="password" type="java.lang.String"/>
</form-bean>

</form-beans>

by writing this you can avoid writing your action form it
will be useful for you generally when the form fields are
more.

Is This Answer Correct ?    3 Yes 0 No

What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to i..

Answer / sandya

Sorry, Im new to Struts. So i didn't get u. if u dont mind
can u please explain once more as understandable way.

Is This Answer Correct ?    2 Yes 0 No

What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to i..

Answer / karnakar

if u have number of jsps in ur application,and in evrey jsp
if u have common propertys like <html:username>for this if
u use actin form for every jsp u need to write action
form ,insted of writing actionform,we configure that
properties into dynaaction form ,by doing this we are
reducing time,

Is This Answer Correct ?    1 Yes 0 No

What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to i..

Answer / ashok

when you create form beans using xml file instead of coding it in java then this is called DynaAction form

Is This Answer Correct ?    1 Yes 0 No

What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to i..

Answer / guest

if u want declare declarative approch for field properites
we can use dynaactionform,
write a class
public class DynaActionServlet(Actionmapping,HttpRequest)
{
dynaactionForm daf=(dynaactionform)af;
---
----
---

Is This Answer Correct ?    2 Yes 2 No

What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to i..

Answer / sandya

thanq penchala, is there any modification in action class(if
we use DynaActionForm instead of ActionForm)?

Is This Answer Correct ?    1 Yes 1 No

What is the DynaActionForm? How we implement the dynaactionform ? can u please tell me the way to i..

Answer / sekhar

Its a class .which can be used to write the for validations
directly in configuration files.No need to write the
forbeans class while using this class.Directly we can do the
validations in the xml file.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Struts Interview Questions

What is action support class in struts2?

0 Answers  


What is role of actionservlet?

0 Answers  


what happen if the private constructor is written in a claass

6 Answers  


In how many ways duplicate form submission can occurs?

0 Answers  


Hi Friends, am new to struts.I read that " you can store variables in xml file(properties file) and for future enhancements we just call properties file . Now i want to implement this , where can i call properties file to enhance my application. My question is where this properties file will be called.

1 Answers  






wahts the diif between Mvc1 and Mvc2?

3 Answers   Wipro,


How properties of a form are validated in Struts?

0 Answers  


Explain about the validation steps which have to be carried during validation of client-side address?

0 Answers  


What is the difference between validation.xml and validator-rules.xml files in struts?

0 Answers  


when connecting with the database,if database server is down,ho can we handle this exception in struts,how can we send error message to the user?

4 Answers   Wipro,


explain the struts-configuration file?

3 Answers   TCS, Zoho,


if u r using eclipse tool how can u debbaging u r application? plz explain with sample code

3 Answers   IBM, Tech Mahindra,


Categories