Ignacio de Córdoba wrote:
i am using FreeMarker to generate HTML content for mails in my application
(not for the web presentation; I use JSP for that).
I so use FreeMarker directly, not integrated to struts.
My problem is localizing messages with parameters. I am invoking the
freemaker template passing the action (it self) as an object. Then I get the
text invoking struts2 ActionSupport getText method:
This works ok when there are no parameters ( ${action.getText("hello")} )
but suppose portalid is a string variable and I try:
${action.getText("pleaseConfirmYouWantToChangeYourPassword",portalid)}
The problem is that portalid variable should be an array of strings, not a
string. I am new to freemarker and don't know if it is possible to define a
string array inside the template. Something equivalent to java:
Have you tried just using array notation? I know FreeMarker supports the
notion of a sequence, but I don't know if it's passable to a Java method
or not. (I'd guess no, but could definitely be wrong.)
You could always just define this in the action, too, either the array
or the results of the getText() itself.
String[] portalidArray = new String[]{portalid};
Is it possible? How?
Maybe you should ask on a FreeMarker mailing list.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]