>From the compoment page http://camel.apache.org/freemarker.html you can use
the CamelFreemarkerResourceUri header for this:
from("direct:in").
setHeader("CamelFreemarkerResourceUri").constant("path/to/my/template.ftl").
to("freemarker:dummy");
Just use a simple expression instead of constant.
Cheers,
Jon
On Fri, Mar 11, 2011 at 3:57 PM, <[email protected]> wrote:
> Hi all,
>
> I'm new to Camel and already searched the mailling list for this issue but
> couldn't find a solution for JavaDSL.
>
> I'd like to build a "to" URI dynamically from a value coming from the body.
> More concrete: I'd like to load a FreeMarker template depending on a body
> value. I've tried this:
>
> to("freemarker://templateHome/${body.templateName}.ftl")
>
> It seems that the URI is not evaluated.
> I also tried this:
>
> to("freemarker://templateHome" + simple("${body.templateName}) + ".ftl")
>
> But both seems not to work. Am I missing something or did I something get
> wrong with the simple syntax usage?
>
> Thanks in advance.
>
> Best regards
> Stephan
> --
> Schon gehört? GMX hat einen genialen Phishing-Filter in die
> Toolbar eingebaut! http://www.gmx.net/de/go/toolbar
>
--
Cheers,
Jon
---------------
FuseSource
Email: [email protected]
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen