On Thu, May 7, 2009 at 5:40 PM, Matteo Redaelli
<[email protected]> wrote:
>
> yes, it works
>
>                                        <setHeader headerName="req-project">
>                                                
> <simple>${in.headers.req-project}</simple>
>                                        </setHeader>
>                                        <setHeader headerName="req-id">
>                                                
> <simple>${in.headers.req-id}</simple>
>                                        </setHeader>
>
>
> where ${in.headers.req-project} is not a header but a property
Yeah it has a fallback on finding in properties if no header exists.

I think simple language can do ${property.req-project} if you want to
indicate its a property
http://camel.apache.org/simple.html



>
> Thanks
> Matteo
>
>
> RomKal wrote:
>>
>> 2009/5/6 Matteo Redaelli <[email protected]>:
>>>
>>> Thanks Claus for you answer, I'll look at the XSD for any future issue.
>>>
>>> But sorry for the silly question: now that I can set a property, how can
>>> I
>>> retrieve it in spring xml?
>>> do I have to set a header with the value of my new property to use it in
>>> a
>>> velocity template?
>>
>> I believe velocity will see it the same way as headers. But I'm not sure.
>>
>> You can of course also set it as header just before velocity endpoint
>> and there is... strange convention that whenever you read your header
>> via header() or <header> it reads the header, but if none exists, it
>> returns the propoerty. So to set a header 'foo' to the value of 'foo'
>> property you do
>>
>> setHeader("foo", header("foo"))
>>
>> looks strange, but works :D
>>
>> Roman
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/How-long-do-the-camel-headers-live-in-routes--tp23375104p23428651.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration
Interview with me:
http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=7893-progress

Reply via email to