Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can my Java classes ask a template for information about its structure (e.g. a list of all the variables)?

0
Posted

How can my Java classes ask a template for information about its structure (e.g. a list of all the variables)?

0

In FreeMarker 2.2, Template has an undocumented method for examining the parsed template: getRootTreeNode. But listing all accessed variables is not possible, because variable names can be dynamically generated from data. However, there’s a more important reason why FreeMarker doesn’t support this. The design of FreeMarker is based on the idea of a separation between business objects and presentation objects.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123