Hi
I'm having a bit of a weird problem with Spring and Tiles. Basically my page is divided into a header, a thinish side bar and the main area. Now my first page loads perfectly in the main area. However when I click on a link to the next page it loads only on the right hand side of the main area, as if the main area is divided exactly down the middle.
I know its a silly mistake on my side but can't figure it out as I click on a link to the first page and that loads fine!
This is the layout specified for each page: (template.jsp)
This is my tiles-defs.xml:Code:<%@ taglib prefix="tiles" uri="http://jakarta.apache.org/struts/tags-tiles" %> <html> <head> <title>Pete's Pet Store</title> </head> <body bgcolor="lightblue"> <table width="100%" border="0"> <tr> <td colspan="2" valign="middle"><tiles:insert name="topbar"/></td> </tr> <tr> <td width="180" valign="top"> <tiles:insert name="sidebar"/> </td> <td valign="top"> <tiles:insert name="main"/> </td> </tr> </table> </body> </html>
This is the page that is causing all the problems! (menu.jsp)Code:<tiles-definitions> <!-- DEFAULT MAIN TEMPLATE --> <definition name="template" page="/WEB-INF/jsp/template.jsp"> <put name="topbar" value="/WEB-INF/jsp/topbar.jsp"/> <put name="sidebar" value="/WEB-INF/jsp/sidebar.jsp"/> </definition> <definition name="index" extends="template" path="/WEB-INF/jsp/template.jsp"> <put name="main" value="/WEB-INF/jsp/hello.jsp"/> </definition> <definition name="menu" extends="template" path="/WEB-INF/jsp/template.jsp"> <put name="main" value="/WEB-INF/jsp/menu.jsp"/> </definition> </tiles-definitions>
But this is the page that is fine:Code:<%@ include file="/WEB-INF/jsp/include.jsp" %> <html> <head><title><fmt:message key="hello.title"/></title></head> <body> <h3><c:out value="${model.menuname}"/></h3> <br> <c:forEach items="${model.menuitems}" var="item"> <img src="image/paw.jpg" align="absmiddle"><a href="<c:url value="${item.url}"/>"><c:out value="${item.description}"/></a><br> </c:forEach> </body> </html>
Please excuse my complete newbieness! Any help would be appreciated!Code:<%@ include file="/WEB-INF/jsp/include.jsp" %> <html> <head><title><fmt:message key="hello.title"/></title></head> <body> <h1><fmt:message key="hello.heading"/></h1> <h3><fmt:message key="hello.products"/></h3> <c:forEach items="${model.products}" var="prod"> <c:out value="${prod.description}"/> <i>$<c:out value="${prod.price}"/></i><br><br> </c:forEach> <br> <a href="<c:url value="priceincrease.htm"/>"><fmt:message key="hello.increaselink"/></a> <br> </body> </html>
Thanks
Kim


Reply With Quote