Java Mailing List Archive

http://www.junlu.com/

Home » FreeMarker-user »

[FreeMarker-user] How To define an array

mousa.Gharaibeh

2011-11-28

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi All,

I wrote the below code :

<#assign content=get_custom_list ("9e3344c0-a641-11e0-9b98-12313d0232b0")>
${content}
<#assign array=[]>
<#list content as x>
<#assign array=array+ [x.value]>
</#list>
${array}

*the results is*
content : [{"value":"4","label":"Jordan 1"},{"value":"13","label":"BEYROUTH
DT"},{"value":"17","label":"Jordan3"},{"value":"18","label":"Moussa
Site"},{"value":"20","label":"mousa"}]

*array* : ["4","13","17","18","20"]

My Question is regarding array's result, when I write this code <#assign
array=[x.value]> instead of the <#assign array=array+ [x.value]>
*the result will be *

["20"] so why I need to define this line: *array +*, also I need a useful
link about an array(*how to define an array*)

*Regards,
Mousa Gharaibeh*


--
Sent from the freemarker-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
FreeMarker-user mailing list
FreeMarker-user@(protected)
https://lists.sourceforge.net/lists/listinfo/freemarker-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.