wood burning stoves 2.0*
The moose likes Struts and the fly likes 3 - level folder display in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "3 - level folder display in struts" Watch "3 - level folder display in struts" New topic

3 - level folder display in struts

Sander Evanfield

Joined: Oct 15, 2004
Posts: 13
I have to show data in Jsp the following way using logic::iterate

Category 1
SubCategory 1

SubCategory 2

Category 2

It is possible that subcategory could be blank in that scenario only have to show reports below Category
these are all Strings.
How do I use datastructure like HashMap and logic::iterate to acheive this

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'd suggest creating a hierarchy of model objects. For example:

public class ReportForm extends ActionForm {
List<Category> categories;
// getters and setters

public class Category {
String categoryName;
List<Category> subCategories;
List<Report> reports;
// getters and setters

Public class Report {
String reportName;
// getters and setters

Then in your JSP:

Consultant, Sima Solutions
wood burning stoves
subject: 3 - level folder display in struts
Similar Threads
URL Rewrite
How to display only selected amount of data from database in two dropdown lists?
I'm totally confused over this one....
Dynamic Drop Down
TransientObjectException: object references an unsaved transient instance