|Home |Login |Registration |Struts Step by Step Tutorial |Hibernate Step by Step Tutorial |Spring Step by Step Tutorial |JSP Step by Step Tutorial |JDBC Step by Step Tutorial |Web Services Step by Step Tutorial |EJB fundamentals | ORACLE Step by Step Tutorial | SCJP 5.0 and SCJP 6.0 Study Guide | SCWCD 5.0 Study Guide | SCJP Tips
Java mock test | SCJP mock test | SCJP DUMP | SCBCD mock test |Java online test exam | JSP online test | ORACLE online test | Hibernate online test | Servlet online test | Struts online test | EJB online test | C online test | C++ online test | Aptitude online test

Java interview questions | JSP interview questions | ORACLE interview questions | Hibernate interview questions | Servlet interview questions | Struts interview questions | JDBC interview questions | C/C++ interview questions | Spring interview questions | JMS interview questions | Informatica interview questions | EJB interview questions | OOPS and Design Pattern interview questions
1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc) JobsJobs and Walkins

 

Recent Questions

!!! Struts Frequently Asked Questions !!!

Q. What is DynaActionForm ? and How you can retrive the value which is set in the JSP Page in case of DynaActionForm ?

SCJP 1.5/1.6 Exam Kit

!!!Answer!!!- From Technical Expert

DynaActionForm is 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.
DynaActionForm eliminates the need of FormBean class and now the form bean definition can be written into the struts-config.xml file. So, i
t makes the FormBean declarative and this helps the programmer to reduce the development time.

For Example : you have a EmpForm and you don't want a java class (EmpForm).
EmpForm has propertis
firstName, lastName, country

In the struts-config.xml file , declare the form bean
<form-bean name="EmpForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="firstName" type="java.lang.String"/>
<form-property name="lastName" type="java.lang.String"/>
<form-property name="country" type="java.lang.String" />
</form-bean>

Add action mapping in the struts-config.xml file:

<action path="/saveEmp" type="com.techfaq.action.EmpSaveAction"
name="EmpForm"
scope="request"
validate="true"
input="/pages/empform.jsp">

<forward name="success" path="/jsp/success.jsp"/>
<forward name="failure" path="/jsp/error.jsp" />

</action>

In the Action class.
public class EmpSaveAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{

DynaActionForm empForm = (DynaActionForm)form;
// this is the way you can retrive the value which is set in the JSP Page
String firstName = (String)empForm.get("firstName");
String lastName = (String)empForm.get("lastName");
return mapping.findForward("success");
}
}
}

In the JSP page
<html:text property="firstName" size="30" maxlength="30"/>
<html:text property="lastName" size="30" maxlength="30"/>

Answered By : null Replied Date : Feb 19 2012
Answer :


Answered By : null Replied Date : Jan 8 2012
Answer :


Answered By : null Replied Date : Nov 26 2011
Answer :


Answered By : null Replied Date : Nov 16 2011
Answer :


Answered By : null Replied Date : Nov 16 2011
Answer :


Answered By : null Replied Date : Nov 14 2011
Answer :


Answered By : null Replied Date : Nov 14 2011
Answer :


Answered By : null Replied Date : Nov 10 2011
Answer :


Answered By : null Replied Date : Nov 4 2011
Answer :


Answered By : null Replied Date : Oct 30 2011
Answer :


Answered By : null Replied Date : Oct 29 2011
Answer :


Answered By : null Replied Date : Oct 26 2011
Answer :


Answered By : null Replied Date : Oct 25 2011
Answer :


Answered By : null Replied Date : Oct 25 2011
Answer :


Answered By : null Replied Date : Oct 22 2011
Answer :


Answered By : null Replied Date : Sep 30 2011
Answer :


Answered By : null Replied Date : Sep 30 2011
Answer :


Answered By : null Replied Date : Sep 28 2011
Answer :


Answered By : null Replied Date : Sep 5 2011
Answer :


Answered By : null Replied Date : Aug 18 2011
Answer :


Answered By : null Replied Date : Aug 17 2011
Answer :


Answered By : null Replied Date : Aug 2 2011
Answer :


Answered By : null Replied Date : Jul 16 2011
Answer :


Answered By : null Replied Date : Jul 6 2011
Answer :


Answered By : null Replied Date : Jun 27 2011
Answer :


Answered By : null Replied Date : Jun 18 2011
Answer :


Answered By : null Replied Date : Jun 15 2011
Answer :


Answered By : null Replied Date : Jun 8 2011
Answer :


Answered By : null Replied Date : May 17 2011
Answer :


Answered By : null Replied Date : Mar 30 2011
Answer :


Answered By : null Replied Date : Mar 29 2011
Answer :


Answered By : null Replied Date : Mar 26 2011
Answer :


Answered By : null Replied Date : Mar 18 2011
Answer :


Answered By : null Replied Date : Mar 4 2011
Answer :


Answered By : null Replied Date : Jan 15 2011
Answer :


Answered By : null Replied Date : Jan 11 2011
Answer :


Answered By : null Replied Date : Dec 27 2010
Answer :


Answered By : null Replied Date : Dec 25 2010
Answer :


Answered By : null Replied Date : Dec 2 2010
Answer :


Answered By : null Replied Date : Nov 30 2010
Answer :


Answered By : null Replied Date : Nov 27 2010
Answer :


Answered By : null Replied Date : Nov 25 2010
Answer :


Answered By : null Replied Date : Nov 25 2010
Answer :


Answered By : null Replied Date : Nov 23 2010
Answer :


Answered By : null Replied Date : Nov 18 2010
Answer :


Answered By : null Replied Date : Nov 15 2010
Answer :


Answered By : null Replied Date : Nov 7 2010
Answer :


Answered By : null Replied Date : Nov 7 2010
Answer :


Answered By : null Replied Date : Nov 7 2010
Answer :


Answered By : null Replied Date : Nov 7 2010
Answer :


Answered By : null Replied Date : Oct 10 2010
Answer :


Answered By : null Replied Date : Sep 25 2010
Answer :


Answered By : Alagu Sundar Replied Date : Aug 21 2009
Answer : Which is Best .....Using Dynamic forms or ActionForm??????


Answered By : null Replied Date : Aug 19 2010
Answer :


Answered By : null Replied Date : Aug 17 2010
Answer :


Answered By : null Replied Date : Aug 15 2010
Answer :


Answered By : null Replied Date : Aug 13 2010
Answer :


Answered By : null Replied Date : Apr 23 2012
Answer :


Answered By : null Replied Date : May 8 2012
Answer :


Answered By : null Replied Date : Jul 16 2012
Answer :


Answered By : null Replied Date : Aug 20 2012
Answer :


Answered By : null Replied Date : Oct 10 2012
Answer :


Answered By : null Replied Date : Nov 16 2012
Answer :


Answered By : null Replied Date : Dec 29 2012
Answer :


Answered By : null Replied Date : Jan 14 2013
Answer :


Answered By : null Replied Date : Jan 25 2013
Answer :


 

You can also contribute to this answer:

Your Name:
Answer:

 
Ask Question and get answer from Expert.
View Answers List from Expert.

The information you are posting should be related to java and ORACLE technology. Not political.