camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Copernico <engcopern...@gmail.com>
Subject Camel Velocity pass ArrayList
Date Thu, 27 Aug 2015 17:17:39 GMT
Hi!

I have a velocity template for send an email. In this template i send to our
clients a list of items (JPA Entities) as an arraylist (is a result of a
query which size may be diferent each time)

Dear ${headers.name}

You request ${headers.itemList.size} items

#foreach(${item} in ${headers.itemList})
 Item ${item.description} - ${item.price}          
#end

With Java DSL i put the headers

exchange.getIn().setHeader("name", client.getName());
exchange.getIn().setHeader("itemList", itemList());


But the testing email i receive, does not have the items list from the
arraylist (the foreach loop is not working) and camel is not replacing
${headers.itemList.size}

Dear George

The items

You request ${headers.itemList.size} items


Any Ideas? How i pass objects like a pojo, a jpa entity, an arraylist to the
velocity template and access to their properties?

Thanks, 







--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Velocity-pass-ArrayList-tp5771027.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message