The signature of .setHeader() is .setHeader(String headerName, Expression expression).
Your itemList() method returns a List, so I'm pretty sure something's missing here. Are you sure that's the code you're running? *Raúl Kripalani* Apache Camel PMC Member & Committer | Enterprise Architect, Open Source Integration specialist http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | twitter: @raulvk On Fri, Aug 28, 2015 at 12:33 PM, Copernico <engcopern...@gmail.com> wrote: > private List<Item> itemList(){ > Query query = em.createNamedQuery("Items.findByDescription", > Items.class); > query.setParameter("description", "something"); > > if(query.getResultList() != null && !query.getResultList().isEmpty()){ > return query.getResultList(); > } > > return new ArrayList(); > } > > > The function is working well: when i debugging the fuction it returns a > list > of item (is not empty). The problem is with adding the list to the header > and using it in a foreach loop in velocity template. > > So the custion is how to use this array list in a foreach loop in velocity? > > Thanks > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-Velocity-pass-ArrayList-tp5771027p5771052.html > Sent from the Camel - Users mailing list archive at Nabble.com. >