开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜