tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Smith" <dhtmlkitc...@gmail.com>
Subject Almost Got it to Work
Date Sat, 12 May 2007 07:23:55 GMT
I'll try and explain my best.

I want to have a master-layout that has a head and a body (attributes,
or decorated content). These attributes, head and body, are also
templates that have attributes (decorated content).

 I can invoke main.layout, but I don't know how to set the pageCSS, et c.


     	<definition name="main.layout " template="/tiles/main-layout.jsp">
      		<put-attribute name="head" value="head.content"/>
     		<put-attribute name="content"   value=" body.content"/>
     		<put-attribute name="body"   value="body.content"/>
      		<put-attribute name="title" />
     		<put-attribute name="pageCSS"/>
     		<put-attribute name="pageJS"/>
      <!-- Used by the main layout  -->
      	<definition name="head.content" template="/tiles/head-content.jsp">
     		<put-attribute name="title" value=""/>
      		<put-attribute name="pageCSS" value=""/>
      		<put-attribute name="pageJS" value=""/>
       <!-- Used by the main layout  -->
     	<definition name=" body.content">
     		<put-attribute name="content" value="/index-content.jsp"/>


     <%@ taglib uri="http://tiles.apache.org/ta gs-tiles" prefix="tiles" %>
      <!DOCTYPE html
          PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd">
     	<%-- Template "head" will have attributes:
      	<tiles:insertAttribute name="head">
     		<tiles:importAttribute name="title" value="title" />
     		<tiles:importAttribute name="pageCSS" value="pageCSS" />
      		<tiles:importAttribute name="pageCSS" value="pageCSS" />
     	<tiles:insertAttribute name="body">
      		<div id="contents">
     			<tiles :putAttribute name="footer" />
     			<jsp:include page="/news/index.html"/>
      			<tiles:insertAttribute name="footer" />


     <%@ taglib uri=" http://tiles.apache.org/tags-tiles" prefix="tiles" %>
      <tiles:insertDefinition name="main.layout">
     	  <tiles:putAttribute name="pageCSS" value="/res/css/pages/index.css" />

 The result:

     <!DOCTYPE html
           PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

      	<link rel="shortcut icon" href='/favicon.ico' />

      	<link rel="Stylesheet" href="/res/skins/1.css" />

     	<script src="/res/js/utils.js" type="text/javascript"></script>

     	<script src="/res/js/treeparams.js" type="text/javascript"></script>
     	<script src="/res/js/AnimTree.js" type="text/javascript"></script>


What happened to the index.css file that I invoked in index.jsp (using
<tiles :putAttribute name="pageCSS")? The value is a valid URL -- I
checked it in the browser.

I just don't know how to do it!

Please advise.

Thank you,


View raw message