Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement map traversal in velocity

Shulou Source: shulou.com Published: 2022-06-03 04:40:43 10月04日 Update

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!

Tags: Articles code content not so much front end name most properties quantity methods more knowledge industry information information channels channels references learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Linux Shulou Technology MariaDB Shulou Tech Info