How to pass a RecordSet or a List of JavaBeans from Action objects to JSPs in Struts?

Posted on 2007-11-16
Last Modified: 2013-11-24
Hi folks,

New to Struts. Wanna to know how to pass a RecordSet object or a List of JavaBeans objects from Action objects to JSPs and then display records in the RecordSet or  beans in the javabeans one by one.

Question by:tiger0516
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 14

Accepted Solution

boonleng earned 500 total points
ID: 20306876
You can either create an ActionForm to store the javabeans.
The following url show how to use action form.

Or directly set the beans into request in Action class.
Struts Action class
  public ActionForward execute(..) throws Exception{
      List listofBeans = manager.getListofbeans(...); // retrieve list of beans from backend
      request.setAttribute("myresult", listofBeans);
      return mapping.findForward("success");

<logic:iterate id="row" name="myresult">
    <bean:write name="row" property="propertyNameInBean"/>.

Author Comment

ID: 20306951

What's this?

LVL 14

Expert Comment

ID: 20307298
That is just an sample code.
you need to change it accordingly to retrieve the list of beans from your codes.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 120
mapShare challenge 13 180
throw exception 21 79
going to wrong jsp page 2 70
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question