camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Foster (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-7303) Simple Language - Header access surrounded with quotes
Date Mon, 17 Mar 2014 13:41:43 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-7303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alan Foster updated CAMEL-7303:
-------------------------------

    Affects Version/s: 2.12.3

> Simple Language - Header access surrounded with quotes
> ------------------------------------------------------
>
>                 Key: CAMEL-7303
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7303
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.12.3
>            Reporter: Alan Foster
>
> Quotes within header access are not currently handled in the same way as the inbuilt
{{headerAs}} function or the body accessor notation - perhaps these should be aligned?
> For instance with the following route
> {code:xml}
>     <camelContext trace="false" xmlns="http://camel.apache.org/schema/blueprint">
>         <route>
>             <from uri="direct:entry"/>
>             <setHeader headerName="some key">
>                 <constant>hello world</constant>
>             </setHeader>
>             <setBody>
>                 <simple>${headers['some key']}</simple>
>             </setBody>
>             <log message="The expression evaluated to :: ${body}" />
>         </route>
>     </camelContext>
> {code}
> Outcome :
> {code}[                          main] route1                         INFO  The expression
evaluated to :: {code}
> Expected :
> {code}[                          main] route1                         INFO  The expression
evaluated to :: hello world{code}
> For reference, the current notation works within other parts of the language and are
handled as expected
> {code}${body['some key']}{code}
> {code}${headerAs('some key', java.lang.Boolean}{code}
> I think the fix might be to use {{StringHelper.removeQuotes}} on line #269 within SimpleFunctionExpression.java
possibly, such as
> {code}remainder = StringHelper.removeQuotes(remainder.substring(1, remainder.length()
- 1));{code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message