Vernon,

Have you read "Tiles Advanced Features" by Cedric Dumoulin?  It is listed
under the Struts userGuide section for Tiles,
http://struts.apache.org/userGuide/dev_tiles.html with a direct URL of:
http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf

Read all subsections under section 4.1 as it will better explain (and with
examples) what I was talking about.

I am unsure if this is a requirement or just something I learned through
trial and error, but when I extend a definition and add a new component, I
make sure to add it to every parent tile (i.e. "this" extended "that" so I
add the fields to "that", but "that" extended "another" so I added those
same component names with some default value to "another.") back up the tree
of definitions.  If you do not define attributes in that strict a manner,
you may fine, as other posters have discovered, that some tiles' JSP
pieces/pages may not be able to see your attributes, especially if your
"body" component is a JSP that needs access to the other tile components.
I'm not explaining this well but the PDF is excellent in describing tiles
concepts with numerous examples.

Regards,
David

-----Original Message-----
From: Vernon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 12, 2005 8:39 PM
To: Struts Users Mailing List
Subject: RE: [Tiles] Why the text doesn't show


David:

After I add empty strings for all insertion components
in the definition xml file, nothing is changed.

When you said "rule of thumb", do you mean what is in
the document or a hacking practice?

regards,

Vernon
>
> The way I've always used Tiles is different from
> your approach.  In the
> struts-tiles.xml definition file, my "template"
> could contain the components
> "title", "category", and "category_menu" with dummy
> values.  The two tiles
> derived from "template", i.e. "landscape" and
> "water", would
> overload/override those fields as necessary.  If you
> define an component
> named "styleSheet" in "landscape" but not in
> "template", when the page
> starts displaying the master tile (i.e. "template"'s
> /WEB-INF/jsp/template/main.jsp JSP), the master tile
> won't know about the
> "styleSheet" component you defined in the later
> child tile named
> "landscape."
>
> My rule of thumb is that you define all components
> in the master tile(s).
> For any tile you extend, make sure you are only
> overriding previously
> defined components as you need them.  They can
> initially be set to blank,
> i.e. "", in "template" so nothing shows up in the
> JSP unless you've
> overridden it in the "landscape" or "water" tiles.
> Why?  Nesting and
> passing components can be difficult or awkward in
> Tiles if you are not VERY
> careful.'
>
> Regards,
> David
>
> -----Original Message-----
> From: Vernon [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 12, 2005 3:26 PM
> To: Struts Users Mailing List
> Subject: RE: [Tiles] Why the text does'nt show
>
>
> Thanks for your response, David. And please see
> below.
>
> "David G. Friedman" <[EMAIL PROTECTED]> wrote:
>
> >
> > A few things come to mind with your below included
> > details:
> >
> > 1: Where are the "taglib" statements in your
> > main.jsp template?
>
> The taglib statement is there as the following:
>
> <%@ taglib prefix="tiles"
> uri="http://jakarta.apache.org/struts/tags-tiles"; %>
>
> Absenting of the statement will lead to miss all
> insertions. In this case, only inserted text is
> missing.
>
> >
> > 2: To use "title" when you "extend" a master
> > template, I'm pretty sure you
> > MUST have a "title" component listed in your
> master
> > template too because you
> > are orverriding it in your "landscape" or "water"
> > templates.
> >
>
> I don't follow above. The inheritance is the
> following:
>
> water <- landscape <- template
>
> Nothing, including the "title", is overriden.
>
> > -----Original Message-----
> > From: Vernon [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, January 12, 2005 2:02 PM
> > To: user@struts.apache.org
> > Subject: [Tiles] Why the text does'nt show
> >
> >
> > In a project, I have the Tiles integrated with
> > Spring.
> > The inserted JSP files show up properly, but not
> > text.
> > I can't find the cause. Here is a segment of the
> > template file
> >
> > <html xmlns="http://www.w3.org/1999/xhtml";
> > xml:lang="en">
> >     <head>
> >             <meta http-equiv="Content-Type"
> > content="text/html;
> > charset=utf-8" />
> >             <link rel="stylesheet" type="text/css"
> > href="css/layout.css" />
> >             <style type="text/css">
> >                     @import "css/text.css";
> >             </style>
> >             <title><tiles:insert name="title"/></title>
> >     </head>
> >     <body>
> > ...
> >
> > In the definition file:
> >
> >     <!-- DEFAULT MAIN TEMPLATE -->
> >     <definition name="template"
> > page="/WEB-INF/jsp/template/main.jsp">
> >     </definition>
> >
> >     <definition name="landscape" extends="template">
> >             <put name="title"       value="Landscape"/>
> >             <put name="category"    value="LANDSCAPE"/>
> >             <put name="category_menu"
> > value="/WEB-INF/jsp/mountains/category.jsp"
> > type="page"/>
> >     </definition>
> >
> >     <definition name="water" extends="landscape">
> >             <put name="sub_category_menu"
> > value="/WEB-INF/jsp/water/sub_category.jsp"
> > type="page"/>
> >     </definition>
> >
> >
> > What is missing here?
> >
> > Thanks
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>




__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
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