문제

I have defined a variable in a FTL template using assign that I would like to be accessible after the template was processed via eg used context map.

How?

도움이 되었습니까?

해결책

See in the FAQ: http://freemarker.org/docs/app_faq.html#faq_retrieve_calculated_values

Environment env = myTemplate.createProcessingEnvironment(root, out);
env.process();  // process the template
TemplateModel x = env.getVariable("x");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top