« Return to Thread: NPE being thrown when using dynamic attributes in stripes layout-render tags with Freemarker templates

NPE being thrown when using dynamic attributes in stripes layout-render tags with Freemarker templates

by Geoff Shuetrim :: Rate this Message:

| View in Thread

Only when using Freemarker templates instead of JSP pages, I am running into an NPE exception that is raised when I use dynamic attributes on Stripes layout-render tags.  The stack trace indicates:
Caused by: java.lang.NullPointerException
	at net.sourceforge.stripes.tag.layout.LayoutRenderTag.setDynamicAttribute(LayoutRenderTag.java:101)
The problem is that the context property of the LayoutRenderTag class is not initialized before the call is made to the setDynamicAttribute(String, String, Object) method.  I can hack together a fix for this by calling the initialize() method of the LayoutRenderTag class whenever the context is found to be null at the start of the setDynamicAttribute(String, String, Object) method.  That works but it makes me nervous.  I am not clear on why the setName method of the LayoutRenderTag class is not being called first and I am not confident that the initialization will always work when required.

This has only become a problem for me since exploring the implications of migrating to Stripes 1.3.7 and Freemarker 2.3.19 from Stripes 1.3.6 and Freemarker 2.3.17.

Regards

Geoff Shuetrim

------------------------------------------------------------------------------
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-users mailing list
Stripes-users@...
https://lists.sourceforge.net/lists/listinfo/stripes-users

 « Return to Thread: NPE being thrown when using dynamic attributes in stripes layout-render tags with Freemarker templates