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
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What is action support class in struts2?
What is role of actionservlet?
what happen if the private constructor is written in a claass
In how many ways duplicate form submission can occurs?
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.
wahts the diif between Mvc1 and Mvc2?
How properties of a form are validated in Struts?
Explain about the validation steps which have to be carried during validation of client-side address?
What is the difference between validation.xml and validator-rules.xml files in struts?
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?
explain the struts-configuration file?
if u r using eclipse tool how can u debbaging u r application? plz explain with sample code