This post helped me get it:
http://camel.465427.n5.nabble.com/How-to-use-escape-tool-esc-xml-somestrwithspclchars-in-camel-velocity-template-td5505668.html
This works for me:
in template:
$headers.StringUtils.leftPad("foo", 10)
java:
public class StringUtilsHelper {
public void addStringUtilsToExchange( final Exchange exchange ) {
exchange.getIn().setHeader( "StringUtils", new StringUtils() );
}
}
Spring xml, application context:
<bean ref="stringUtilsHelper" />
<spring:bean id="stringUtilsHelper"
class="mypackagenamehere.StringUtilsHelper" />
--
View this message in context:
http://camel.465427.n5.nabble.com/padded-text-and-or-static-classes-in-velocity-template-of-velocity-component-tp5736136p5736147.html
Sent from the Camel - Users mailing list archive at Nabble.com.