Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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()

1 vote


Accepted answer

Permanent link
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

2 votes


One other answer

Permanent link
can someone mark my answer (second post) as the accepted answer? I cannot

0 votes

Comments

Done. Thanks, Sam.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,019

Question asked: Jan 15 '13, 1:34 p.m.

Question was seen: 5,425 times

Last updated: Jan 16 '13, 2:28 p.m.

Confirmation Cancel Confirm