[
http://www.stripesframework.org/jira/browse/STS-817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577#comment-12577
]
Peter Mahoney commented on STS-817:
-----------------------------------
Thanks for the update. There still appears to be a problem. I am getting a NPE:
root cause
java.lang.NullPointerException
net.sourceforge.stripes.tag.layout.LayoutContext.lookup(LayoutContext.java:85)
net.sourceforge.stripes.tag.layout.LayoutComponentRenderer.toString(LayoutComponentRenderer.java:173)
java.lang.String.valueOf(String.java:2826)
java.lang.StringBuilder.append(StringBuilder.java:115)
java.util.AbstractMap.toString(AbstractMap.java:490)
java.lang.String.valueOf(String.java:2826)
java.lang.StringBuilder.append(StringBuilder.java:115)
net.sourceforge.stripes.tag.layout.LayoutContext.toString(LayoutContext.java:269)
net.sourceforge.stripes.tag.layout.LayoutRenderTag.doEndTag(LayoutRenderTag.java:181)
...
Here is a testcase to reproduce the problem:
<s:layout-render name="wrapper.jsp">
<s:layout-component name="wrapped">
wrapped
</s:layout-component>
</s:layout-render>
wrapper.jsp:
<s:layout-definition>
<s:layout-render name="wrapper2.jsp">
<s:layout-component name="head">
${head}
<s:layout-render name="included.jsp" />
</s:layout-component>
<s:layout-component name="wrapped">
${wrapped}
</s:layout-component>
</s:layout-render>
</s:layout-definition>
wrapper2.jsp:
<s:layout-definition>
<s:layout-render name="wrapped3.jsp">
<s:layout-component name="head">
${head}
</s:layout-component>
<s:layout-component name="wrapped">
${wrapped}
</s:layout-component>
</s:layout-render>
</s:layout-definition>
wrapped3.jsp:
<s:layout-definition>
${head}
WRAPPED-START
${wrapped}
WRAPPED-END
</s:layout-definition>
included.jsp:
<s:layout-definition>
included
</s:layout-definition>
I have found that if the included.jsp tag is moved elsewhere e.g. within the
"wrapped" layout-component, then the NPE goes away.
> Stack Overflow when using a layout with an existing component name
> ------------------------------------------------------------------
>
> Key: STS-817
> URL: http://www.stripesframework.org/jira/browse/STS-817
> Project: Stripes
> Issue Type: Bug
> Components: Tag Library
> Affects Versions: Release 1.5.6
> Reporter: Peter Mahoney
> Assignee: Ben Gunter
> Priority: Minor
> Fix For: Release 1.5.7, Release 1.6
>
>
> I have used this pattern successfully in 1.5.3, but it fails in
> 1.5.6-SNAPSHOT:
> Page:
> <s:layout-render name="testlayout.jsp">
> <s:layout-component name="pageContent">
> HELLO
> <s:layout-render name="testinclude.jsp">
> <s:layout-component name="pageContent">
> INCLUDED
> </s:layout-component>
> </s:layout-render>
> </s:layout-component>
> </s:layout-render>
> testlayout.jsp:
> <s:layout-definition>
> LAYOUT
> ${pageContent}
> </s:layout-definition>
> testinclude.jsp:
> <s:layout-definition>
> INCLUDE:
> ${pageContent}
> </s:layout-definition>
> The outout I expect is:
> LAYOUT HELLO INCLUDE: INCLUDED
> The output I get is:
> LAYOUT HELLO INCLUDE: HELLO INCLUDE: HELLO INCLUDE: ... repeated until a
> stack overflow
> In this simple test case, renaming the included layout component fixes this
> problem, but in my actual case it then fails to include anything. I am not
> sure why that is, but suspect the cause is the same as in this simple case.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development