Dynamical attributes for <layout-render> may cause NullPointerException with
FreeMarker
---------------------------------------------------------------------------------------
Key: STS-889
URL: http://www.stripesframework.org/jira/browse/STS-889
Project: Stripes
Issue Type: Bug
Components: Tag Library
Affects Versions: Release 1.5.7
Environment: FreeMarker 2.3.18, Tomcat 6.0.20
Reporter: Uri Savelchev
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.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development