【Velocity】关于List中是否有某个值

使用contains函数即可判断false、true

boolean java.util.List.contains(Object o)

Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that (o == null ? e == null : o.equals(e)).

样例

#foreach($status in $map.order)
	<option value="$status" #if($!map.orderSelection.contains($status)) selected = "selected" #end>
		$!{orderStatus.getDesc($!{status})}
	</option>
#end
posted @ 2019-05-05 13:36  ZMemory  阅读(937)  评论(0)    收藏  举报