How to implement map traversal in velocity
Editor to share with you how to achieve map traversal in velocity, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
List traversal in velocity is relatively simple, so map traversal, here are two kinds of velocity Map
Ergodic method,
Two kinds of velocity traversing map
Java Code:
Soft attribute: quantity num, name name
Soft soft = new Soft ("3", "iqiyi app")
SoftTypeMap {1,soft}
Front-end code:
1:
# foreach ($item in $! softTypeMap.entrySet ())
$! {item.key}. $! {item.value.name} / 1. Iqiyi app
# end
2:
# foreach ($item in $! softTypeMap.keySet ())
$! {item}. $! {softTypeMap.get ($item) .name} / / 1. Iqiyi app
. # end
The above is all the content of the article "how to implement map traversal in velocity". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!