• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to print multi-level list in jstl (Spring)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to print a multi-level list like this using jslt in Spring, how to code the controller and jsp?

News-cat-1
- News item1
- News item2
- News item3
News-cat-2
- News item1
- News item2
- News item3
News-cat-3
- News item1
- News item2
- News item3

Here is my controller code:


Thanks!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like a straight-forward use of nested <c:forEach> loops to create the nested lists. Give the code a try and post back with any difficulties you may be having.

However, I would reconsider the construct you are passing to the JSP. Hint: you only really need one scoped variable for the whole nested construct.
 
reply
    Bookmark Topic Watch Topic
  • New Topic