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 the use of token interceptor in Struts2?
What is the purpose of form-be tag in struct-config.xml?
What are different Struts2 tags? How can we use them?
why we are using vo,dao and dto design patterns in struts framework
What is the purpose of @doublerangefieldvalidator annotation?
what is project architecture?give brief explanation about project architecture?
3 Answers CTS, Etisalat, IBM, Infinite Computer Solutions, Mphasis,
How is the Struts framworl related to MVC2?
How can we group related actions in one group in Struts?
wat happen when the connection is nt closed in jdbc n what vl happen when i interchange in executequery n execute statements
What is dispatchaction?
Is there a particularly good ide to use with struts?
State an example of struts configuration file as an action parameter for action servlet.