WARNING: This server is unstable and will be retired in the next days.
If you want to keep this forum available, please request immediately a migration
on the Nabble Support forum.
Forums that don't receive any migration request will be deleted forever.
I'm trying to display a list of items in a collection using JSTL.
Each item in the collection has x, y, z and id variables.
The user can choose whether he wants the display order (of the items
in the collection) to be
1) x y z
2) z y x
As far as I know the display ordering can be accomplished in two ways:
1) as shown in the code snippet below, create two different loops for
each display format. The drawback with this approach is that a lot of
the common stuff is duplicated between the two loops.
2) Have a c:choose , selection within a single loop, which decides
between the two formats. The drawback is that the the same condition
checking repeats for each loop iteration.
Is there a way to set the formatting outside the loop , and use that
format in the loop to address the two drawbacks above.