问题描述:

I have a MyMethod class that implements TemplateMethodModel. I need to pass a HashMap to the args of the exec function.

How can I do that from a ftl template ?

FYI I have tried ${myMethod({"key":"value"})} but inside curly brackets are not accepted..

Thanks in advance for your help.

网友答案:

You need to use TemplateMethodModelEx, as TemplateMethodModel converts the arguments to string (it's a legacy...). (You still won't get a HashMap, but a TemplateHashModelEx.)

相关阅读:
Top