Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Platform 225 - Content Search
Description
As of FreeMarker 2.3.26, it is able to recognize the default method implementations in the interfaces, but the option is not enabled by default for backward compatibility. See https://issues.apache.org/jira/browse/FREEMARKER-24 for detail.
In the previous version or even in the latest version such as 2.3.28, the current provision, without extra setting, FreeMarker templates are not able to recognize the default methods in interface level if the implementation class does not override it.
In order to be able to use default methods in the interface level, we need to either (a) create FreeMarker Configuration object by new freemarker.template.Configuration(VERSION_2_3_26) or higher version or (b) invoke setTreatDefaultMethodsAsBeanMembers(true} on the Configuration#getObjectWrapper().
The second option would be the safest way for now.
Reference: