Hi
You could use constant for this, just like this
from("direct:start").
setHeader("foo", constant("ABC")).
to("mock:result");
Willem
G.J. van de Streek wrote:
> Is there a way to use string constants in the simple expression language. I
> am trying to fix a deprecation warning in:
>
> from("direct:saveAgentsFile")
> .setHeader(FileComponent.HEADER_FILE_NAME, "agents.xml")
>
> .to("file:///Users/streekgj/Desktop/filestore/?append=false")
> ;
>
> I tried to change it to:
>
> .setHeader(FileComponent.HEADER_FILE_NAME, new
> SimpleExpression("agents.xml");)
>
> Of course it is treated as an expression, but is there any way to mark it as
> an string literal, or escape the dot? Something like:
>
> .setHeader(FileComponent.HEADER_FILE_NAME, new
> SimpleExpression("'agents.xml'");)
> or
> .setHeader(FileComponent.HEADER_FILE_NAME, new
> SimpleExpression("agents\\.xml");)
>
> Or do string literals only works with operations?