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

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user,gmane.comp.java.stripes.user
Message-ID <[email protected]>
The author of the JSP support doesn't hang around much anymore... and
I'm not exactly a JSP wizard. But I guess FreeMarker doesn't properly
implement some of the more modern JSP features. If someone with deeper
JSP knowledge can fix this or can give a hint, that could make fixing
this faster.


Sunday, June 3, 2012, 9:19:20 AM, Geoff Shuetrim wrote:

> 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

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.