0
是否有任何Groovy方法將List轉換爲字符串與值從消息屬性取代?Groovy - 列表到字符串與message.properties
<g:message code="label.promotion.create.short.${command.daysList.join(",")}"/>
從list
輸出數據,而我想從message.properties採取code
需求爲逗號通過迭代列表分離
顯然,我能做到這一點,像這樣
<g:each in="${command.daysList}" var="day" status="count">
<g:message code="label.promotion.create.short.${day}"/>
<g:if test="${count+1 < command.daysList.size()}">, </g:if>
</g:each>
這很棒... –