AnsweredAssumed Answered

How to dump/print array key=>value info?

Question asked by L.Elias Champion on Aug 18, 2014
Latest reply on Aug 18, 2014 by L.Elias

I'm trying to output the key=>value pairs of an array but not getting any info. It seems to be looping through the array but not printing anything. I found the following in another post to du mp all the context vars but I'm trying to limit it to a specific array:

<core:forEach var="entry" items="${q_weights.rows}"> 
  <gel:log level="INFO" category="DEBUG" var="include_log"> ${entry.getKey()} = ${entry.getValue()} |  ${entry.getValue().getClass().getName()} </gel:log>  
</core:forEach>

But all I get is:

[DEBUG] = | 

Right now I'm just trying to log the info as a concept, but long term my thinking is to make this a standalone file with the array as a variable I would set in my main script (an SQL result more than likely, with updated values), then use this to loop through the results to create an element for a XOG. Something like:

 

<ColumnValue name="${key}">${value}</ColumnValue>

which would then be included in an overall XOG call

Outcomes