I have a problem with tiles
I have a template (mainLayout) which does basically the following:
<html>
<body>
...
<jsp:include page="/services" />
...
</body>
</html>
The url /services
is served by a Spring controller which uses Tiles3. The /services
url is using a different layout (rawLayout) which just outputs a jsp.
The problem is that the code is generating a stackoverflow error. Actually, when trying to render the /services
url with a raw layout, Tiles is actually switching to mainLayout.
I debugged Tiles, and even though the definition is correct (rawLayout), the BasicTilesContainer::getAttributeContext
method is switching back to the originating layout (mainLayout). It seems that Tiles is not using the template from the definition, but takes it from an execution stack.
My tiles definition:
<definition name="main" template="/WEB-INF/tiles/layout/mainLayout.jsp">
<put-attribute name="content" value=""/>
</definition>
<definition name="full" template="/WEB-INF/tiles/layout/fullLayout.jsp">
<put-attribute name="content" value=""/>
</definition>
<definition name="services" extends="full">
<put-attribute name="content" value="/WEB-INF/jsp/services.jsp" />
</definition>
I hope this is clear enough.
Thanks