aspose file tools*
The moose likes Struts and the fly likes How to pass Arraylist values from an actionClass to a JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to pass Arraylist values from an actionClass to a JSP page" Watch "How to pass Arraylist values from an actionClass to a JSP page" New topic
Author

How to pass Arraylist values from an actionClass to a JSP page

nethra kanike
Greenhorn

Joined: Sep 07, 2011
Posts: 4
Hi all,
Iam new to Struts, can any one one help me, how we can retrive arralist values in JSP page from an actionclass. I need the snippet of jsp code.

Thanks and Regards
Nethra
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

How do you want to display the data?


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
nethra kanike
Greenhorn

Joined: Sep 07, 2011
Posts: 4
in a table format
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

No dude, I mean like radio button or combo box or check box or only text messages in a table.
nethra kanike
Greenhorn

Joined: Sep 07, 2011
Posts: 4
only a text in a table
nethra kanike
Greenhorn

Joined: Sep 07, 2011
Posts: 4
Hi sir,
Iam getting the values in the ActionClass in an ArryList. Iam retrieveing username registration no and email. The values are getting printed on console like below.

{nethra, 1939438, nethra.kanike@gmail.com}

I want these details to be printed in a jsp page in row of a table.
Orton K Randy
Ranch Hand

Joined: Aug 12, 2011
Posts: 41

If the arraylist exits in any of the formbeans, <jsp:getProperty> should do. Or if you're retrieving from elsewhere in action class, try setting the data in request(or any appropriate scope) and use JSTL(like here). Since yours is an Object, request(or any appropriate) scoped attributes should be fine.


Coderanch, best ever forum on the net. Hands down.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to pass Arraylist values from an actionClass to a JSP page