File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes DynaActionForm Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "DynaActionForm Error" Watch "DynaActionForm Error" New topic

DynaActionForm Error

Paul Giancola

Joined: Dec 16, 2002
Posts: 6
Hello all,
I'm having an issues using Struts 1.1. b3 on Tomcat 4.1.18.
I have an arraylist I'm placing in a DynaActionForm in one of my action classes. When I do so I get a
error when placing the object in the DynaFrom.
I'm new to struts, any help would be appreciated.

Thanks,<p>Paul C. Giancola
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
Can we see your form and what you are doing in your action?
Paul Giancola

Joined: Dec 16, 2002
Posts: 6
Here is the form entries in my struts-config.xml and the code from my action where I attempt to put the objects in the form.
<form-property name="projects" type="java.util.ArrayList"/>
<form-property name="issues" type="java.util.ArrayList"/>
public class WelcomeAction extends Action
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException,
SQLException, NamingException
//Getting user ID
HttpSession session = request.getSession(true);
PersonView user = new PersonView();
user = (PersonView) request.getSession().getAttribute(Constants.USER_KEY);
String userId = user.getPersonUserName();

//Retrieving projects
ArrayList projects = new ArrayList();
projects = ProjectsDB.projects(userId);
((DynaActionForm)form).set("projects", projects);

//Retrieving issues
ArrayList issues = new ArrayList();
issues = IssuesDB.issues(userId);
((DynaActionForm)form).set("issues", issues);

//Forwarding to the appropriate page
return (mapping.findForward(Constants.SUCCESS_KEY));
I agree. Here's the link:
subject: DynaActionForm Error
It's not a secret anymore!