<definition name=".mainLayout" path="/layout/classicLayout.jsp">
      <put name="title"  value="Berechtigung WEB with Tiles" />
      <put name="header" value="/top_menu.jsp" />
      <put name="menu"   value="/toc.jsp" />
      <put name="footer" value="/footer.jsp" />
      <put name="body"   value="/welcome.jsp" />
</definition>

<definition name=".showOrgEinheit" extends=".mainLayout">
      <put name="body" value="foobar" type="definition" />
</definition>

<definition name="foobar" page="/layout/bodyTwoColumns.jsp">
	<put name="input" value="/getOrgEinheit.jsp" />
	<put name="result" value="/showOrgEinheit.jsp" />
</definition>

What you are really doing is making a definition from another definition, and therefore, you need to seperate the definitions. This is one aspect of Tiles that I would like to see improved upon, although I don't really have any magical ideas at present on how to do it. It is definately a powerful and very useful tool, but since it is just in its infancy, it needs some improvement.

-----Original Message-----
From: struts-user-digest-help@jakarta.apache.org
[mailto:struts-user-digest-help@jakarta.apache.org]
Sent: Monday, December 08, 2003 7:32 AM
To: struts-user@jakarta.apache.org
Cc: oliver.wulff@zurich.ch
Subject: Antwort: RE: Tiles, Definition inheritence

Wouldn't it make sense that the inserted tiles has access to the tiles
context either?
I think, my requirement is quite common. I think that the main layout of a
web application won't change but the body tile contains sometimes one tile
or is splitted in an upper- and lower-part or a left- and a right-part.
It's a little bit unhandy to copy the classicLayout.jsp to another layout
jsp and add the input- and result-part. Therefore, layout code is
duplicated.

Does my requirement contradict the design of tiles?

******************************************************************
Oliver Wulff
Zürich Versicherungs-Gesellschaft
IA4, CoC Middleware
Postfach, 8085 Zürich
Telefon: +41- 1 628 58 07
Fax: +41 - 1 623 58 07
E-Mail: mailto:oliver.wulff@zurich.ch

                                                                       
                      "List Mailbox"                                   
                      <calvin@holview.c        An:       "Struts Users Mailing List" <struts-user@jakarta.apache.org>
                      om>                      Kopie:                  
                                               Thema:    RE: Tiles, Definition inheritence
                      08.12.2003 15:10                                 
                      Bitte antworten                                  
                      an "Struts Users                                 
                      Mailing List"                                    

Only the template definition called can 'see' the Tiles context and access
the attributes.  In your case the classicLayout.jsp can use the input and
result attributes.  If the bodyTwoColumns.jsp is to be your layout then
changing classicLayout.jsp to have the two columns format would be the best
solution.  You could also pass the attributes from the template to the
input
jsps but that becomes difficult to extend or change because you have
explicit variables you are creating in your template jsp for other jsps to
use.

Cal
www.calandva.com

-----Original Message-----
From: struts-user-return-100933-calvin=holview.com@jakarta.apache.org
[mailto:struts-user-return-100933-calvin=holview.com@jakarta.apache.org]On
Behalf Of Oliver Wulff
Sent: Monday, December 08, 2003 6:16 AM
To: struts-user@jakarta.apache.org
Subject: Tiles, Definition inheritence

Hi

I'm quite new to Tiles and I've got the following problem:

I've defined the following default definition:
<definition name=".mainLayout" path="/layout/classicLayout.jsp">
      <put name="title"  value="Berechtigung WEB with Tiles" />
      <put name="header" value="/top_menu.jsp" />
      <put name="menu"   value="/toc.jsp" />
      <put name="footer" value="/footer.jsp" />
      <put name="body"   value="/welcome.jsp" />
</definition>

The classicLayout.jsp hasn't been changed (Struts examples).

Additionally, I've defined the following Definition:
<definition name=".showOrgEinheit" extends=".mainLayout">
      <put name="input" value="/getOrgEinheit.jsp" />
      <put name="result" value="/showOrgEinheit.jsp" />
      <put name="body" value="/layout/bodyTwoColumns.jsp" />
</definition>

The bodyTwoColumns looks like this:
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<table border="0" width="100%" cellspacing="5">
<tr>
  <td width="50%" align="left">
    <tiles:insert attribute='input'/>
  </td>
  <td width="50%" align="left">
    <tiles:insert attribute='result' />
  </td>
</tr>
</table>

My struts action forwards to the definition .showOrgEinheit but I get the
following error:
[ServletException in:/layout/bodyTwoColumns.jsp] Error - Tag Insert : No
value found for attribute 'input'.'

Can anybody help me, please? Thank you a lot.

Cheers
Oliver

******************* BITTE BEACHTEN *******************
Diese Nachricht (wie auch allfällige Anhänge dazu) beinhaltet
möglicherweise vertrauliche oder gesetzlich geschützte Daten oder
Informationen. Zum Empfang derselben ist (sind) ausschliesslich die
genannte(n) Person(en) bestimmt. Falls Sie diese Nachricht
irrtümlicherweise erreicht hat, sind Sie höflich gebeten, diese unter
Ausschluss jeder Reproduktion zu zerstören und die absendende Person
umgehend zu benachrichtigen. Vielen Dank für Ihre Hilfe.

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

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

******************* BITTE BEACHTEN *******************
Diese Nachricht (wie auch allfällige Anhänge dazu) beinhaltet
möglicherweise vertrauliche oder gesetzlich geschützte Daten oder
Informationen. Zum Empfang derselben ist (sind) ausschliesslich die
genannte(n) Person(en) bestimmt. Falls Sie diese Nachricht
irrtümlicherweise erreicht hat, sind Sie höflich gebeten, diese unter
Ausschluss jeder Reproduktion zu zerstören und die absendende Person
umgehend zu benachrichtigen. Vielen Dank für Ihre Hilfe.