On Sep 28, 2005, at 7:39 PM, Guillermo Castro wrote:

In order to do what you want you have to define your tiles as:

<!-- main layout -->
<definition name="Main.layout" path="/_common/layouts/mainLayout.jsp">
  <put name="header" value="layout.header" />
  <put name="footer" value="/_common/layouts/tiles/_footer.jsp" />
</definition>

<definition name="layout.header" path="/_common/layouts/_header.jsp">
  <put name="title" value="Test" />
</definition>

<!-- test Page -->
<definition name="Test.page" extends="Main.layout">
</definition>

At the risk of stating the obvious, if you want your title to be specified in the extended definition you can do it like this:

<!-- main layout -->
<definition name="main.layout" path="/mainlayout.jsp">
  <put name="title" value="dummy title" />
  <put name="header" value="/header.jsp" />
  <put name="footer" value="/footer.jsp" />
</definition>

<definition name="test.page" extends="main.layout">
  <put name="title" value="Test" />
</definition>

Then your mainlayout.jsp:

  <tiles:useAttribute name="title"/>
  <tiles:insert attribute="header">
    <tiles:put name="title" value="${title}" direct="false"/>
  </tiles:insert>

And your header.jsp:

   Title is: <tiles:getAsString name="title"/>

It's a bit wicked but it works.

Greg


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

Reply via email to