what best proceed opening an array inside velocity?
i have java array such as:
string[] arr = new string[] {"123","doc","projectreport.doc"};
in opinion healthy proceed opening be:
#set($att_id = $arr[0])
#set($att_type = $arr[1])
#set($att_name = $arr[2])
but working. i have workaround. nonetheless bit too many formula such an easy task.
#set($counter = 0)
#foreach($el $arr)
#if($counter==0)
#set($att_id = $el)
#elseif($counter==1)
#set($att_type = $el)
#elseif($counter==2)
#set($att_name = $el)
#end
#set($counter = $counter + 1)
#end
is there any way?
Comments
Post a Comment