It's all about the answers!

Ask a question

rtc 4, email template, character replace problem. - solved


sam detweiler (12.5k6195201) | asked Jan 15 '13, 1:34 p.m.
edited Jan 15 '13, 5:07 p.m.
According to the RTC support guide, the Email template language is Apache Velocity.
the Apache Velocity language says that I should be able to manipulate the contents of variables using the java string class methods.

and example is
#set( $a = "Hello" )
#set( $b = "+" )
#set( $c = $a.replace("l", ${b}) )
${c}


but I get an error when I try this..

Invalid reference $a.replace()

Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Jan 15 '13, 4:46 p.m.
edited Jan 15 '13, 4:48 p.m.
have to GET the thing in string format first

#set( $a = "Hello" )
#set( $b = "+" )
#set( $c = $a.toString().replace("l", ${b}) )
${c}


displays He++o

#set( $c = $a.toString().replace("l", "+")
${c}


does the same
Jared Burns selected this answer as the correct answer

One other answer



permanent link
sam detweiler (12.5k6195201) | answered Jan 16 '13, 2:23 p.m.
can someone mark my answer (second post) as the accepted answer? I cannot

Comments
Jared Burns commented Jan 16 '13, 2:28 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Done. Thanks, Sam.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.