[
https://issues.apache.org/jira/browse/TILES-544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13256470#comment-13256470
]
Viktor Hedefalk edited comment on TILES-544 at 4/18/12 1:26 PM:
----------------------------------------------------------------
It seems that this code in BasicTilesContainer:
{code}
protected void render(TilesRequestContext request, Definition definition) {
AttributeContext originalContext = getAttributeContext(request);
BasicAttributeContext subContext = new
BasicAttributeContext(originalContext);
subContext.inherit(definition);
pushContext(subContext, request);
try {
render(request, subContext);
} finally {
popContext(request);
}
}
{code}
is related to the problem.
What happens is this:
* I hava a main "portal" controller+view with a tile definition.
* This portal references other controllers dynamically
* This is done with insertTemplate, c:import or jsp:include pointing to a
controller with a view referencing another tile definition.-
* The inserted controller correctly does it's thing resulting in a model and
view.
* The view is correctly resolved to its tile definition
* the view has a templateAttribute correctly set.
* But then, when the TilesView calls the TilesContainer to render, the
inheritance thingy above makes the templateAttribute of the subContext be the
template of the SURROUNDING tile definition. The old one that made the include
that is. So then I guess this surrounding view is called over and over again by
itself I hit a stackoverflowerror.
was (Author: hedefalk):
It seems that this code in BasicTilesContainer:
{code}
protected void render(TilesRequestContext request, Definition definition) {
AttributeContext originalContext = getAttributeContext(request);
BasicAttributeContext subContext = new
BasicAttributeContext(originalContext);
subContext.inherit(definition);
pushContext(subContext, request);
try {
render(request, subContext);
} finally {
popContext(request);
}
}
{code}
is related to the problem.
What happens is this:
* I hava a main "portal" controller+view with a tile definition.
* This portal references other controllers dynamically
* This is done with insertTemplate, c:import or jsp:include pointing to a
controller with a view referencing another tile definition.-
* The inserted controller correctly does it's thing resulting in a model and
view.
* The view is correctly resolved to its tile definition
* the view has a templateAttribute correctly set.
* But then, when the TilesView the TilesContainer to render, the inheritance
thingy above makes the templateAttribute of the subContext be the template of
the SURROUNDING tile definition. The old one that made the include that is. So
then I guess this surrounding view is called over and over again by itself I
hit a stackoverflowerror.
> Stack overflow due to rendering loop when including a resource resulting in
> another tiles view.
> -----------------------------------------------------------------------------------------------
>
> Key: TILES-544
> URL: https://issues.apache.org/jira/browse/TILES-544
> Project: Tiles
> Issue Type: Bug
> Affects Versions: 2.2.2
> Environment: Spring MVC 3.1.1
> Reporter: Viktor Hedefalk
> Attachments: tiles-stackoverflow.txt
>
>
> I get a stackoverflow because of a rendering loop when including an call to a
> controller with a view is also a tile. This is a dup of TILES-418, but since
> that one was closed and I couldn't attach my stack trace, I'll open this new
> one.
> To me this is very critical. I just upgraded an application from Spring 2.0.7
> and old struts-tiles to Spring 3.1.1 and tiles 2.2.2 and the structure worked
> with struts-tiles. It's kind of a homebrew portlet thingy where we iterate
> over url:s pointing to controllers given by a cms.
> The included controller is called correctly and returns a model and view
> where the view points to a tile definition. But when Spring gives over the
> rendering to tiles, the loop begins.
> It doesn't matter if I include the url with:
> <tiles:insertTemplate name="${entry.url}" />
> or
> <c:import url="${entry.url }" />
> the same error occurs.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira