Uploaded image for project: 'Stripes'
  1. STS-889

Dynamical attributes for <layout-render> may cause NullPointerException with FreeMarker

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not a Bug
    • Affects versions: Release 1.5.7
    • Fix versions: Release 1.6
    • Components: Tag Library
    • Labels:
      None
    • Environment:
      FreeMarker 2.3.18, Tomcat 6.0.20
    • Sprint:

      Description

      LayoutRenderTag initializes its LayoutContext in the initialize() method that is called from setName(), expecting that setName() is called prior to setDynamicAttribute(). It is explained in the comments that it can't be called from setPageContext() due a dependency on setName(). I didn't find the dependency, but hit another problem: FreeMarker does not guarantee the order in that the attributes are set. In result the setDynamicAttribute() method may be called prior to setName() and then it causes a NullPointerException because 'this.context' is not initialized yet.

      I resolved it for myself by overloading setPageContext() and moving the initialize() call into the method.

        Attachments

          Activity

            People

            • Assignee:
              rgrashel Rick Grashel
              Reporter:
              alterrebe UriS
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: