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}
精彩评论