Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

DynaActionForm Error

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
org.apache.struts.action.RequestProcessor.processException
error when placing the object in the DynaFrom.
I'm new to struts, any help would be appreciated.
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we see your form and what you are doing in your action?
 
Paul Giancola
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
*****struts-config.xml*****
<form-bean
name="personProjectsForm"
dynamic="true"
type="org.apache.struts.action.DynaActionForm">
<form-property name="projects" type="java.util.ArrayList"/>
</form-bean>
<form-bean
name="personIssuesForm"
dynamic="true"
type="org.apache.struts.action.DynaActionForm">
<form-property name="issues" type="java.util.ArrayList"/>
</form-bean>
*****Action*****
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));
}
}
 
You got style baby! More than this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic