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

Head Contribution Tag should skip its behavior in non-RENDER_PHASE automatically

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 5.4.0
    • None
    • None

    Description

      If a freemarker template, containing a head contribution tag, is invoked in HST Resource URL serving phase, it throws an UnsupportedOperationException because the HstResourceResponse does not support operations such as #containsHeadElement(...).
      That makes sense.
      However, it might be better and more useful if the head contribution tag (<@hst.headContribution/>) simply skips its default behavior if HstRequest#getLifecyclePhase() doesn't equal to "RENDER_PHASE", not to invoke any unsupported operations on HstResponse.
      In projects, sometimes it is very hard to find the root cause if the head contribution tags are nested in a freemarker macros with some conditions. Sometimes it's working, sometimes not working as a result.
      A small improvement like this would help avoid any extra effort in projects.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: