You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stephen Smithstone <sk...@lchost.co.uk> on 2003/04/16 11:05:02 UTC

Tiles Problem :-/

Im having some problems with my tiles follows is my tiles-defs.xml and some 
jsp pages

tiles-defs.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles 
Configuration//EN" "http://jakarta.apache.org/struts/dtds/tiles-config.dtd">
<tiles-definitions>
  <definition name="main.layout" page="/pages/layouts/layout1.jsp">
    <put name="title" value="ITextIT Web Interface" />
    <put name="header" type="page" value="&quot;&quot;" />
    <put name="footer" type="page" value="&quot;&quot;" />
  </definition>
  <definition name="main.index" extends="main.layout">
    <put name="body" value="/pages/main/index.jsp" />
  </definition>
  <definition name="access.index" extends="main.layout">
    <put name="body" value="/pages/access/index.jsp" />
  </definition>
  <definition name="messagedesk.index" extends="main.layout" 
controllerClass="sbhp.external.itextit.actions.MessageDeskTilesController">
    <put name="body" value="/pages/md/index.jsp" />
  </definition>
  <definition name="messagedesk.viewmessage" extends="messagedesk.index">
    <put name="body" value="/pages/md/viewmessage.jsp" />
  </definition>
  <definition name="send.index" extends="main.layout">
    <put name="body" value="/pages/send/index.jsp" />
    <put name="option" value="/pages/send/single.jsp"/>
  </definition>
  
</tiles-definitions>

layout1.jsp
<%@ page contentType="text/html; charset=ASCII" %>
<%@ taglib uri="/jstl/core" prefix="c" %>
<%@ taglib uri="/jstl/xml" prefix="x" %>
<%@ taglib uri="/struts/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/struts/struts-html.tld" prefix="html" %>
<%@ taglib uri="/struts/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/struts/struts-tiles.tld" prefix="tiles" %>
<html>
<head>
<title>

<tiles:getAsString name="title"/>

</title>
</head>
<tiles:importAttribute/>

<body bgcolor="#ffffff">

<table align='center' border='1' width='100%' cellspacing='0'>
<tr><td colspan='100%' align='left'>Powered By <a 
href='http://www.skullboxhouse.co.uk'>Skullboxhouse Productions</a></td></tr>
<tr><td colspan='100%' align='center'>Title / Logo Here</td></tr>
<tr>
<td>
<tiles:insert attribute="body"/>

</td>
</tr>
<tr><td colspan='100%' align='center'><tiles:insert 
attribute="footer"/></td></tr>

</table>
</body>
</html>

now in my sturts action im forwarding to send.index

which has the folowing jsp
<%@ page contentType="text/html; charset=ASCII" %>
<%@ taglib uri="/jstl/core" prefix="c" %>
<%@ taglib uri="/jstl/xml" prefix="x" %>
<%@ taglib uri="/struts/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/struts/struts-html.tld" prefix="html" %>
<%@ taglib uri="/struts/struts-tiles.tld" prefix="tiles" %>

<table align='center'>

<tr><td colspan='100%' align='center'>Send Message</td></tr>
<tr><td colspan='100%'><hr/></td></tr>
<tr>
<td>Reply</td>
<td>Single</td>
<td>Multi</td>
<td>Group</td>
</tr>

<tr><td>


<tiles:insert attribute="option"/>
</td></tr>


</table>

so my thinking is that send.index extends main.layout then adds another 
attribute called option which points to a page how ever when i go to that 
page i get the following error

[ServletException in:/pages/send/index.jsp] Error - Tag Insert : No value 
found for attribute 'option'.'

Cheers

Ste


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org