Prevent system properties/variables being evaluated in Java properties?

I am using Spring to load properties:

<util:properties id="service-properties">
        ...
        <prop key="postScript"></prop>
        ... 
</util:properties>

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" id="propertyConfigurer"><property name="properties" ref="service-properties" />
</bean>

However, one of the properties can have a value like the following (this is a camel xml simple language snippet):

postScript=<setBody><simple>${in.header.type}</simple></setBody>

The problem, is when I get the value of this property, it is:

postScript=<setBody><simple></simple></setBody>

I think it seems to be trying to resolve the ${in.header.type} variable, thinking it is a system variable maybe?

I'd like to know how to stop this variable being resolved? I've tried escaping it with quotes but no good.

Answers


Got an answer for this from the Camel docs :-)

http://camel.apache.org/simple.html

Alternative syntax

From Camel 2.5 onwards you can also use the alternative syntax which uses $simple{ } as placeholders. This can be used in situations to avoid clashes when using for example Spring property placeholder together with Camel.


Need Your Help

Rails mongoid ordered embeds_many association

ruby-on-rails mongoid

I have document User and I want to store ordered stack of another users in this document. Example structure of User document:

breaking down how to sort numbers in an array

javascript arrays sorting

I'm going over this sorting tutorial and I'm having problems understanding it.