We're updating the issue view to help you get more done. 

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

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.

Environment

FreeMarker 2.3.18, Tomcat 6.0.20

Status

Assignee

Rick G

Reporter

UriS

Labels

None

Tester

None

Components

Fix versions

Affects versions

Release 1.5.7

Priority

Major