File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes EL providing indentation dots Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "EL providing indentation dots" Watch "EL providing indentation dots" New topic
Author

EL providing indentation dots

Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

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

Joined: Jan 10, 2002
Posts: 61766
    
  67

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.



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

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

Joined: Jan 10, 2002
Posts: 61766
    
  67

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
 
subject: EL providing indentation dots