File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL providing indentation dots

 
Pat Farrell
Rancher
Posts: 4660
5
Linux Mac OS X VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to produce an indented list and wonder if a pure EL structure can make it happen. An example list would look like


Bear
. motorcycle
. . Harley
. . Yamaha
. car
. . Yugo
Pat
. motorcycle
. . Hodaka
. . Yamaha
. car
. . Pontiac
. . Lincoln

I've got a EL variable ${indent} for each record
Is there some way to do something like

for (int i = 0, i < ${indent}; i++ ) {
" . "
}

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to loop with just the EL. You'll need the JSTL forEach action for that.

(Or create a custom tag, or EL function, for this specific purpose.)

And, Bear drives a Mazda MX-5.

 
Pat Farrell
Rancher
Posts: 4660
5
Linux Mac OS X VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This does the trick

<c:forEach var="i" begin="1" end="${entry.indent}" step="1">

</c:forEach>

Wow, Bar, that's a small car, its almost lighter than your current Yahama
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pat Farrell wrote:This does the trick ...


Wow, Bar, that's a small car, its almost lighter than your current Yahama

I guess it's as close to a motorcycle I could get in a car.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic