We are running Spring MVC with tiles as well and I can tell you that in certain exception conditions, it will render the first part of the JSP twice. Finding that exception can be difficult, but I've sometimes found it in Catalina.err under tomcat.
Sorry I couldn't help more. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2008 4:25 AM To: [email protected] Subject: Problem with JSTL, c:set I have a rather annoying issue, which I can't get around for some reason. We're using Spring MVC, together with Tiles 2 in our project. So far, we didn't have any issues. We configured the template, added a header and footer and everything was fine. The problem is when we try to add the c:set-tag to one of our tiles. When we do this, for some reason none of the content which is below that c:set-tag is rendered. All the content that's above the c:set-tag is rendered twice. Does anyone know what the problem could be? We use taglibs-standard v1.1.2 and jstl-v1.1.2 in our project. I tried jstl-v1.2 but with the same problem. I already tried to remove the taglibs-standard or the jstl-library but with no result. This is the configuration of the tiles: <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN" "http://tiles.apache.org/dtds/tiles-config_2_0.dtd"> <tiles-definitions> <!-- DEFAULT MAIN TEMPLATE --> <definition name="template" template="/WEB-INF/jsp/template/template.jsp"> <put-attribute name="header" value="/WEB-INF/jsp/header.jsp" /> <put-attribute name="menu" value="/WEB-INF/jsp/menu.jsp" /> <put-attribute name="footer" value="/WEB-INF/jsp/footer.jsp" /> </definition> <!-- Pages --> <definition name="welcome" extends="template" /> </tiles-definitions> When we add this to the menu.jsp: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <div> <p>TESTING TESTING</p> <c:if test="true"> <p>TESTING 1 TESTING 1</p> </c:if> <c:set var="bodyContent" value="Body Content defined by and el" /> </div> We get as a result twice TESTING TESTING TESTING 1 TESTING 1 and the last </div> isn't rendered. So c:if works (c:choose also), so the problem doesn't lie with the core library. I think the problem is with scopes, but I really have no idea what could be the cause of this problem. This is my spring configuration: <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"> <property name="definitions"> <list> <value>/WEB-INF/tiles-def.xml</value> </list> </property> </bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="order" value="1" /> <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView" /> </bean> I've been looking at this for hours and I have really no idea what the problem could be. I checked the example that comes with the tiles distribution, but I can't see any difference between that and my application. Everything is deployed on Weblogic 9, so there's support for servlet specs 2.4 and JSP 2.0. I really hope someone on this mailinglist can figure out the problem. Also, when i add c:set variable to the template page, I get this stacktrace: org.apache.tiles.TilesException: Error including path '/WEB-INF/jsp/template/template.jsp'. erroneous handlers at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:42 7) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:37 0) at org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputMode l(TilesView.java:75) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:2 58) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.j ava:1174) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServl et.java:901) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServle t.java:809) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkSer vlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java :501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSe curityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelpe r.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W ebAppServletContext.java:3231) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec t.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletC ontext.java:2002) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext. java:1908) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:136 2) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) Caused by: java.io.IOException: Error including path '/WEB-INF/jsp/template/template.jsp'. erroneous handlers at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletT ilesRequestContext.java:201) at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(Servlet TilesRequestContext.java:185) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:41 9) ... 22 more
