| Author |
EL providing indentation dots
|
Pat Farrell
Rancher
Joined: Aug 11, 2007
Posts: 4437
|
|
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: 56529
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Pat Farrell
Rancher
Joined: Aug 11, 2007
Posts: 4437
|
|
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: 56529
|
|
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.
|
 |
 |
|
|
subject: EL providing indentation dots
|
|
|