I'm using RTFTemplate with velocity engine.
With pure velocity I can do spmething like:
$someBean.Method( $someBean.property )
Can I do that through RTFTemplate?
I need to use getter's with parameters!
I found no way to do that.
If someone could help me..
thanks!
Logged In: NO
RTFTemplate don't support method with parameter.
If you have class with this method :
public class Project {
public String getValue(String key) {
if (key.equals("1"))
return "One";
return "Two";
}
}
and after you use it into RTF model like this
$project.getValue('1')
After merging, you will have
«One»
and not
One
characrecters '«' and '»' are RTF code of RTF mergefield, which should be removed by RTFTemplate
when it found the field into fields.xml.
So RTFTemplate must be improved to detect method with parameter in order to detect fields and remove RTF code of mergefield
to remove '«' and '»' characters.