Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

3 - level folder display in struts

 
Sander Evanfield
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to show data in Jsp the following way using logic::iterate

Category 1
SubCategory 1
rpt1-name
rpt2-name

SubCategory 2
rpt1-name
rpt2-name

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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic