开发者

In Freemarker - how do I get the first value in a map

开发者 https://www.devze.com 2023-04-04 00:39 出处:网络
in Java I would do something like this: map.v开发者_JAVA百科alues().iterator().next(); How do you do it in Freemarker? something like this?

in Java I would do something like this:

map.v开发者_JAVA百科alues().iterator().next();

How do you do it in Freemarker? something like this?

${map?values?first()}


${map?values[0]}

Or if you are not sure that the map is not empty:

${map?values[0]!someDefault}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号