If you are using the XML definition factory then you should call the definition 
instead of the jsp. So in your JSP to call the definition it should look like this:

<tiles:insert definition="mainLayout " flush="true"/>

mainLayout then will provide the link to Layout.jsp do to the "path" attribute.  Then 
your Layout.jsp will have access to the attributes.  When I use useAttribute I give 
the bean an id (optional it will be the name of the attribute if not included)  like 
this (the scope is optional - but request will allow other embedded jsps have access 
to the bean).

<tiles:useAttribute id="head" name="head" scope="request"/>


Cal

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 19, 2003 06:26
To: [EMAIL PROTECTED]
Subject: Tiles: attribute 'head' not found in context


Hi list, I have a problem getting tiles definitions to work (using
Struts 1.1).
It works fine, when I use <tiles:put name="head" value="Kopf.jsp" /> in
my JSP pages,
but not with the XML:

Here is the code in my tiles-defs.xml
    <definition name="mainLayout" path="Layout.jsp">
        <put name="head"  value="MeinKopf" />       
    </definition>
   
And here is Layout.jsp:
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:useAttribute name="head"/>


And here is the JSP I use to call Layout.jsp:
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="Layout.jsp" flush="true">
</tiles:insert>


The error I get is:
[ServletException in:Layout.jsp] Error - tag useAttribute : attribute
'head' not found in context. Check tag syntax'

If I call Layout.jsp right away, I get:
ServletException: Error - tag useAttribute : no tiles context found

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  
Learn more about Paymentech's payment processing services at www.paymentech.com
THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary 
and confidential information intended only for the use of the recipient(s) named 
above.  If you are not the intended recipient, you may not print, distribute, or copy 
this message or any attachments.  If you have received this communication in error, 
please notify the sender by return e-mail and delete this message and any attachments 
from your computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to