I am converting an existing Tiles 1 panel into a Tiles 2 architecture. I am having problems transferring values from a JSP page to tile attributes.
Here is my tile definition file (tiles-definition.xml)
<tiles-definitions> <definition name="cda.layout" template="/jsp/layouts/layout.jsp"> <put-attribute name="pageTitle" value="StoryTitle" type="string"/> <put-attribute name="pageHeader" value="StoryHeader" type="string"/> <put-attribute name="resources" value="" type="string"/> </definition> </tiles-definitions>
layout.jsp looks like this:
<html> <head> <title><tiles:insertAttribute name="pageTitle" flush="true"/></title> </head> <body> ... ... <div class="content"> <h1><tiles:insertAttribute name="pageHeader" flush="true"/></h1> </div> ... ... </body> </html>
I have a history page that uses a layout and should pass values to the attributes of the template.
<% // create a business object and populate String mytitle= story.getTitle(); String myheader = story.getHeader(); %> <tiles:insertTemplate template="../layouts/layout.jsp" flush="false" > <tiles:putAttribute name="pageTitle" value="${mytitle}"/> <tiles:putAttribute name="pageHeader"value="${myheader}"/> </tiles:insertTemplate>
In story.jsp, I can System.out.print () the values mytitle, myheader, and they show the correct one. But these values are NOT passed to the tile attributes.
Any idea how to fix this?
spring jsp tiles
Srinath dasu
source share