Well, I myself have just started out with struts and tiles too, but I'm
going to take a crack at your question...

I don't really see why you have two page titles.  You are setting a page
title for the menu area of the page and the support area of the page,
but you are still talking about only 1 page composed of multiple
tiles...

Here is what I think you are trying to do.


==================Layout.jsp=====================
<%@ page language="java"%>

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>
  <head>
                <title>
                        <tiles:getAsString name="title"/>
                </title>
  </head>
  
  <body>
    <table width="100%" height="100%" border="0" cellspacing="0"
cellpadding="0">
        <tr>
                <td height="20%"><tiles:insert attribute="menu"/></td>
        </tr>
        <tr>
                <td height="70%"><tiles:insert attribute="content"/></td>
        </tr>
    </table>
  </body>
</html:html>


==================support.jsp===================
<%@ page language="java"%>

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <tiles:insert page="Layout.jsp">
        <tiles:put name="title" type="string" value="Support"/>
        <tiles:put name="menu" type="page" value="menu.jsp"/>
        <tiles:put name="content" type="page" value="support.html"/>
    </tiles:insert>


===================================================

And as far as I understand your question.  That should do what you
want.  Essentially You just want to create one page from multiple pages,
so remember that your menu.jsp and support.html won't need to have all
components of a page such as their own titles, headers, footers,
html:head html:body etc, etc.  The layout should take care of all that
for you.

-josh


On Sun, 2004-05-09 at 06:59, John Moore wrote:
> 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
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to