The tiles context is defined around the definition actually called - in your case 
aPage.  So main.jsp can see baseAttribute and set it up for subsequent pages.

You should 'see' the attribute if you put the following in main.jsp prior to 
tiles:insert for header or body.

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

You can then access it like a typical bean in body.jsp or header.jsp use either a 
scriplet or logic tags like this:

<logic:equal name=" baseAttribute" value="sample">
        <b>got it</b>
</logic:equal>


Cal

-----Original Message-----
From: Reinhard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 09:53
To: Struts Users Mailing List
Subject: RE: accessing Attribute of a parent-tile-definition

Bad luck. I didn't succeed with the suggestion of Cal.

I searched the archive for the cited posting. I found it, but it does not fit
my needs. I tried anything like Cal's suggestion, but it did not work for me.

I have no Jsp-file where I import a tile and for so I have no place to put the
<tiles:useAttribute...>.
My tiles reside in XML-files and I use defintion names as action target.
The jsp-file where I need the attribute is a component and the base
tile-definition has no jsp-file.

Following the documentation, the <put ...> statement has no scope attribute,
but the <definition ...> has such an attribute. So I added a scope-attribute
to the <definition ...>
The result is a SAXParseException saying attribute "scope" must be declared
for element type "definition".

Remember my situation:
tiles-config.xml:
        <definition name="base">
                <put name="baseAttribute" value="sample"/>
        </definition>
        <definition name="aPage" extends="base" path="main.jsp">
                <put name="header" value="header.jsp"/>
                <put name="body" value="body.jsp"/>
        <definition>

Now in page main.jsp I can access attribute "baseAttribute".
But in header.jsp as well as body.jsp I got the error: attribute
"baseAttribute" not found in context.
Also I tried to extend the base definition with a "dummy.jsp", just containing
the <tiles:useAttribute ...>, but I could not access the attribute in i.e.
body.jsp. 
In the body.jsp I tried the access with <tiles:getAsString ...> and with
<bean:write ...>

So I have no more idea, what to try.

Anybody out there, who could help me?

Thank you for any help.

kind regards

Reinhard

---------------------------------------------------------------------
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