others
Velocity에서의 Map 사용
aircook
2009. 11. 24. 09:28
다음과 같이 사용하면 됩니다.
#set ($portalMap = {"NAVER" : "http://www.naver.com/", "DAUM" : "http://www.daum.net/", "NATE" : "http://www.nate.com/", "YAHOO" : "http://kr.yahoo.com/"})
#foreach ( $entry in $portalMap.entrySet())
<li>$velocityCount.<a href="$entry.getValue()" target="_blank">$entry.getKey()</a></li>
#end