Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-4721

Enable FreeMarker servlet to recognize the default methods in interfaces

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 14.1.0
    • 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:

      Attachments

        Activity

          People

            Unassigned Unassigned
            wko Woonsan Ko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: