struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Moore <j...@jmsd.co.uk>
Subject Tiles - getting parent attribute?
Date Sun, 09 May 2004 11:59:14 GMT
I've just started getting into Tiles, and am having some difficulty 
getting my head around some of the nesting concepts. I'm hoping someone 
can show me the way to do what is rather a simple task. I seem to have 
ended up again with the requirement to have a JSP tag evaluated to 
provide the value for another one, which is illegal, and which leads me 
to suppose I am taking the wrong approach...

I have a 'general.jsp' page, which is a form of the standard 'classic 
layout' template, with header, menu and body. Within it I insert the 
menu tile thus:

    <tiles:insert page="menu.jsp" flush="true"/>

The general.jsp template is used by specific pages such as the Support 
one, thus:

    <tiles:insert page="general.jsp">
        <tiles:put name="pageTitle" type="string" value="Support"/>
        <tiles:put name="body" type="page" value="support.html"/>
    </tiles:insert>


All well and good. Now, though, I want to know within the menu.jsp page 
which specific page I'm on. If I could nest JSP tags, I could do it like 
this:

    <tiles:insert page="menu.jsp" flush="true">
       <tiles:put name="pageTitle" type="string" 
value="<tiles:getAsString name='pageTitle'/>"/>
    </tiles:insert>

But of course I can't do this. My suspicion is that I've got the whole 
thing back to front. Where do I go from here? This has to be an easy 
thing to do!

John


-- 
=============================================
John Moore     -    Norwich, UK    -    john@jmsd.co.uk
=============================================

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


Mime
View raw message