Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials

Core Java
JSP
Servlet
JDBC
Hibernate
Struts 1
Struts 2
JSF
Spring
J2EE
J2ME
Web Services
Ajax
Dojo
MySQL
Latest Comments
library management
comment
Servlets with the
trigger
Make me a Trigger
  All Comments...
 

 

 
Struts Tutorials
*Stuts TOC
*Apache Struts Introduction
* Struts Controller
* Struts Action Class
* Struts ActionFrom Class
* Using Struts HTML Tags
*Struts Validator Framework    
*Client Side Address Validation    
*Struts Tiles
*tiles-defs.xml
*Struts DynaActionForm
*Struts File Upload
*Struts DataSource
*AGGREGATING ACTIONS
*Internationalization
Struts Resources
*Struts Books
*Struts Articles
*Struts Frameworks
*Struts IDE
*Struts Alternative
*Struts Links
*Struts Presentations
*Struts Projects
*Struts Software
*Struts Reference
*Struts Resources
*Other Struts Tutorial
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Struts DynaActionForm

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

36 comments so far (post your own) View All Comments Latest 10 Comments:

The method saveErrors(HttpServletRequest, ActionErrors) in the type Action is not applicable for
the arguments (HttpServletRequest, ActionMessages)

in action class execute method when i placed the above code it is giving me the above error. please suggest. thanks in advance.

Posted by gopikrishna on Wednesday, 04.2.08 @ 17:41pm | #55126

Is it possible to use validator plugIn with DynaActinForm in struts? If yes, can any body provide example for that? I tried but didn't succeeded.

Posted by Ravindra on Tuesday, 02.12.08 @ 10:22am | #47978

which one is better Action Form or Dyna Action

Posted by krishna on Thursday, 01.17.08 @ 17:44pm | #45447

all the examples are worth learning. In DynaActionForm is there any internal method called saveErrors(HttpServletRequest, ActionMessages).

If Not please, in Struts DynaActionForm section explain saveErrors method in action class AddressDynaAction.

Thanks & Regards,
sathish.g.

Posted by sathish kumar.g. on Monday, 01.7.08 @ 14:38pm | #44704

This information provided by you is very useful. and you keep on updadting these technologies.

Posted by srividya on Thursday, 01.3.08 @ 10:21am | #44416

Very Nice Example !!!

Posted by Sandeep Natoo on Friday, 12.7.07 @ 17:08pm | #41544

are u using strutsdyna actin

Posted by tejj on Saturday, 11.17.07 @ 12:15pm | #37613

IT is reaaly really good stuff. very much useful to learn, simple, easy to understand.

Posted by Geetha on Thursday, 09.6.07 @ 23:11pm | #25319

hii,
I want codes of a demo struts project to know struts briefly.Plz help me.It's urgent

Posted by Manas on Wednesday, 08.8.07 @ 18:15pm | #22947

every thing fine in my logoin form that contains name,adderss,email,and my bean class contain setrs and geters,reset().i have done my action class. modifiy the strtus cinfig.xml my application did not work plz help me

Posted by vidyasagar on Tuesday, 08.7.07 @ 13:08pm | #22843

This validation form is not enough to learn differences like actionform,dynaactionform,vlidatrorform and dynavalidator from please give much more discription about this

Posted by vijay on Thursday, 06.14.07 @ 16:35pm | #19205

I think action classes are not singletone classes.
only actionservlet(all serlets) is the singletone class

Posted by sridhar on Monday, 06.4.07 @ 15:42pm | #18172

i need a source code in java how to restrict the user to access some website urgently.please help me

Posted by priyanka on Tuesday, 05.29.07 @ 11:01am | #17616

starters always go through this materials.

Posted by indu on Thursday, 05.17.07 @ 18:41pm | #16273

Please tell me whether struts Action Class class is singleton or not.

Posted by kishore on Thursday, 05.10.07 @ 18:37pm | #15581

Hello
can any body tell me why we declare
form type="java.lang.string (or) java.lang.Integer in struts-config.xml for struts DynaActionForm

Please tell me .Its urgent

Posted by kishore on Thursday, 05.10.07 @ 18:36pm | #15580

I the above example the form validation is done in Action class, which is incorrect, can I declare form validation in struts-config.xml
Please reply

Posted by Praveen on Monday, 05.7.07 @ 16:22pm | #15404

Hi,
Im not able to print error messages.. everything else is working fine... plzz help me...

Posted by vishnu on Wednesday, 04.25.07 @ 17:52pm | #14919

Cannot retrieve definition for form bean DynaAddressForm
I am getting this error message while running this example .Kindly help this poor soul

Posted by umadas on Tuesday, 04.3.07 @ 11:43am | #13252

Hi, I am facing a problem in retrieving a jsp using struts framework. I am getting the error "Form bean not specified on mapping for action: "/SetNewPassword". struts config is as below:

=======================================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<form-beans>
<!-- BaseAction form bean (abstract) -->

<form-bean name="LogonForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="username" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
</form-bean>
<form-bean name="ChangePasswordForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="username" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
<form-property name="newpassword" type="java.lang.String" />
<form-property name="confirmnewpassword"
type="java.lang.String" />
</form-bean>
</form-beans>

<global-forwards>
<forward name="Logoff" path="/Logoff.do" />
<forward name="Logon" path="/Logon.do" />
<forward name="Failure" path="/Error.do" />
</global-forwards>


<action-mappings>
<action path="/toModule"
type="org.apache.struts.actions.SwitchAction" />

<!-- Display any other page (Logon, MainMenu) - Wildcards must come first! -->
<action path="/*" forward="/{1}.jsp"></action>

<action path="/SetNewPassword" type="com.jayaraj.login.action.ChangePasswordAction" name="ChangePasswordForm"
scope="request" validate="false" input="/ChangePassword.jsp">
<forward name="Success" path="/Logon.do" />
</action>

<!-- Process a user logon -->
<action path="/SubmitLogon"
type="com.jayaraj.login.action.LogonAction" name="LogonForm"
scope="request" cancellable="true" validate="false"
input="/Logon.do">
<exception key="expired.password"
type="com.jayaraj.exceptions.ExpiredPasswordException"
path="/ChangePassword.do" />
<forward name="Success" path="/HomePage.do" />
</action>


</action-mappings>

<message-resources
parameter="org.apache.struts.apps.mailreader.resources.ApplicationResources" />

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation/validation.xml" />
</plug-in>

</struts-config>
==============================================

I have defined 2 form beans and 2 action mappings. The "/SubmitLogon" action works fine, but "/SetNewPassword" is giving "Form bean not specified on mapping for action". Could any one help me resolve this problem.

Posted by Prasad on Monday, 03.26.07 @ 20:41pm | #12741

I had a doubt regarding in getting Date value from the Dynaform and assigning it to the database by convert it into required format

Posted by vineela on Saturday, 03.10.07 @ 22:29pm | #11338

Excellent MR Ramaswamy articles are fentastic

Posted by sundaram on Friday, 03.9.07 @ 12:14pm | #11228

This works great, if one knows the number of fields that will be displayed on the form. How would one code for a variable number of field and their values being retrieved from a DB.?? Particularly if one is trying to validate the values once a user has modified them.
Any help would be very much appreciated. I have looked @ several options, but none of them seem to work.

TIA


Posted by AR on Sunday, 02.25.07 @ 02:49am | #9499

hi, it's really good stuff, that is no worry about form bean and properties dynamically to code.Its working and it is so simple

Posted by ARJUNSANAPATHI on Wednesday, 02.21.07 @ 23:32pm | #8758

Hi,

Download it from Download the code

Deepak

Posted by Deepak Kumar on Wednesday, 02.21.07 @ 11:34am | #8673

plz. provede the war filr for the examples.

Posted by Prajakta on Wednesday, 02.21.07 @ 11:04am | #8666

Hello
I am not able to display error messages in the DynaAddress.jsp
Errors are getting added to errors object in AddressDynaAction.java file since errors.size is 3
But not getting displayed in jsp.
I tried the alternative solution provided by Mr.Daniel for Mr.Ravi's query, but still no change in the result.
Kindly help.

Posted by Archana on Saturday, 02.17.07 @ 04:47am | #8112

ya It is really a good example.

Posted by manoj kumar on Thursday, 02.1.07 @ 18:03pm | #5228

Thank u for ur feed back in struts framework application.
Pls tell me about the eclipse . How to use the eclipse for the java appliations. If any tutorials for learning the eclipse pls inform me
thanking u

Posted by jagadeesh on Friday, 01.19.07 @ 23:14pm | #3863

In dynaActionfrom only suports String only,
or can we use other like Integer and Collections
like arraylist

Posted by JP on Tuesday, 01.16.07 @ 11:10am | #3592

Ravi:
If you are using Struts 1.1 you should replace the above code with the following

//Create object of ActionMesssages
ActionErrors errors = new ActionErrors();
//Check and collect errors
if(((String)addressForm.get("name")).equals("")) {
errors.add("name",new ActionError("error.name.required"));
}

if(((String)addressForm.get("address")).equals("")) {
errors.add("address",new ActionError("error.address.required"));
}

if(((String)addressForm.get("email")).equals("")) {
errors.add("email",new ActionError("error.emailaddress.required"));
}
//Saves the error
saveErrors(request,errors);

Remember taht the use of ActionMessages to hold error messages instead of ActionErrors is rather unfortunate. In earlier versions of Struts, it would have indeed been ActionErrors, but later versions have deprecated the use of ActionErrors everywhere except as the return value of validate() in ActionForm.

Posted by Daniel on Friday, 12.29.06 @ 20:17pm | #2224

Its a very good example and very simple to understand.

Posted by Manoj on Tuesday, 12.26.06 @ 11:10am | #2027

Can we maintain more than one Message resource file(ApplicationResource.properties) in a web application.If Yes How?
If No Why?

Posted by RamaRao.G on Monday, 12.11.06 @ 18:05pm | #854

thanks

Posted by aman on Thursday, 12.7.06 @ 12:28pm | #583

hi

im trying to compile the AddressDynaAction code in my system one error will be occur i.e

AddressDynaAction.java:46: saveErrors(javax.servlet.http.HttpServletRequest,org.
apache.struts.action.ActionErrors) in org.apache.struts.action.Action cannot be
applied to (javax.servlet.http.HttpServletRequest,org.apache.struts.action.Actio
nMessages)
saveErrors(request,errors);
^

please check that error and update that code

Posted by ravi on Monday, 12.4.06 @ 13:01pm | #380

Very good tutorial ever found for struts.
Thanks for yor information.

Posted by skinchu on Friday, 12.1.06 @ 00:57am | #268

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Back to Tutorial

 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.