I have two items from my model and I want to iterate them at the same using jstl foreach. how can I achieve this using a correct syntax?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You can call
varStatus.index
to get the index of the current round of iteration, and then use it as a lookup for the second list.For example, if you have two lists
people.firstnames
andpeople.lastnames
you can do:I assume you have to collections that you want to iterate in one go. Add a getter which will merge these two collections and use it for the iteration. For example
Iteration in JSTL: