Solution number 2, propagate the value down:

headerContentFooter.jsp:
<tiles:useAttribute name="nav_key" />
<p>nav_key = <%=nav_key%><p>
<tiles:insert attribute="content">
        <tiles:put name="nav_key"><tiles:getAsString name="menuMain"/></tiles:put>
</tiles:insert>

-----Original Message-----
From: Manish Singla [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 02, 2003 4:15 PM
To: Struts Users Mailing List
Subject: Re: tiles and parameters


You are getting error because "nav_key" is in page context.
thus you cannot retrieve value in included page...

YOu may use <tiles:useAttribute name="nav_key" scope="request" />
in headercontentfooter.jsp


Frank Maritato wrote:
> Hi all, I'm having a problem passing a parameter down from a tiles 
> definition to a jsp. I can access the value easily in the layout 
> definition, but I can't get access to it in a file (or action) I'm 
> inserting into the layout. Here is an example of what I'm doing (cut 
> down a bit)
> 
> tiles.xml:
> <definition name="mp.main" path="/tiles/layout/headerContentFooter.jsp">
>   <put name="nav_key"    value="mp" type="string"/>
>   <put name="content"    value="/showcontent.do" />
> </definition>
> 
> headerContentFooter.jsp:
> <tiles:useAttribute name="nav_key" />
> <p>nav_key = <%=nav_key%><p>
> <tiles:insert attribute="content" />
> 
> samplecontent.jsp:
> <bean:define id="nav_key" name="nav_key" />
> <b>nav_key::: <%=nav_key%></b>
> 
> So I'm getting an error in samplecontent.jsp that there is no such 
> variable in any scope. How can I get it? I can print out the value fine 
> in the headerContentFooter layout. I also tried adding a 
> <tiles:useAttribute> in samplecontent.jsp to try and get access to the 
> variable but that didn't work either. Any help would be appreciated.
> 
> Thanks!


-- 
Thanks
Manish Singla
x73166


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


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

Reply via email to