camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reuben Garrett <reubengarr...@gmail.com>
Subject Re: How to use escape tool ($esc.xml($somestrwithspclchars)) in camel velocity template
Date Thu, 23 Feb 2012 19:59:07 GMT
Ramesh,

I'm not as knowledgeable as the committers, but it looks like you're trying
to attach an instance of the EscapeTool class to a header in your Exchange
and then invoke it later on inside the Velocity template.  But when you use
a <constant/> expression in the Spring DSL, it just returns the text within
the <constant/> tags as a String.

Christian's example in the Java DSL seems closer because it's actually
attaching a Class object (rather than the name of the class).  Maybe if you
somehow instantiate an instance of EscapeTool and attach it to the
exchange, you'll then be able to invoke it.   The Java DSL might be more
direct for this, but I'll bet there's an easy way to do it in the Spring
DSL, too.

That being said, I don't know much about Velocity.  However the <constant/>
expression doesn't seem to be what you want.

Claus, Christian - am I on the right track?

~ RNPG

On Thu, Feb 23, 2012 at 11:15, ramesri <ramesh.sridharan@ihg.com> wrote:

> Sorry, I set the header as and no luck.
>
> <setHeader headerName="esc">
>
>
> <constant>org.apache.velocity.tools.generic.EscapeTool.class</constant>
>
> </setHeader>
>
>
> Thanks
> Ramesh
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message