I have try a lot of possibilities with Tiles, but never this one ;-).

  You are facing the same problem than  with <iterate> tag, because <put> tag
implements 'BodyTag'. It does so to be able to read its body. In fact, only tags
needing to read their body implements 'BodyTag'. Unfortunately, it is not
possible to use include() method in such body (which is what <get> or <insert>
does).
  This is a limitation from jsp1.1.

  To resume, you can't insert or get a page inside the body of a <put> tag.

    Cedric


David Corbin wrote:

> Well, I don't think it's either of the two cases you cited.  Here is what I
> have essentially:
> I"ve leftout some minor niceities in the interest of space.  This is not
> using any tags other than tiles.
>
> --A.jsp--
> <tiles:insert template="B.jsp">
>  <tiles:put name="leftColumn" value="C.jsp"/>
> </tiles:insert>
> --end--
>
> --B.jsp--
> <tiles:insert template="D.jsp">
>      <tiles:put name="body">
>         <table cellspacing="0" width="100%">
>              <tiles:get name="leftColumn"/>
>         </table>
>     </tiles:put>
> </tiles:insert>
> --end--
>
> --D.jsp--
> <HTML>
>     <BODY>
>         <tiles:getAsString name="body">
>     </BODY>
> </HTML>
> --end--
>
> --C.jsp--
> <TR>
>     <TD> Page C</TD>
> </TR>
> --end--
>
> The top portion of the stack trace is:
> Illegal to flush within a custom tag at
> javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:87) at
> org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.ja
> va:729) at
> org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:365) at
>
> This is the insert tag in B.jsp above.
>
> If I change the <tiles:get> to <tiles:getAsString>, everything works, except
> I get "C.jsp", rather than the content from it.
>
> I even tried adding "flush='false'" to both tiles:insert tags.
>
> AND, C.jsp is really that simple. (at this point).
>
> Any further ideas?
>
> ----- Original Message -----
> From: "David Corbin" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, October 03, 2001 6:17 AM
> Subject: Re: Tiles: using tileContent inside another tile
>
> > Hmmm... I will explore more deeply, but the three tiles I was trying to
> > include were really just raw HTML.  No real .JSP code whatsoever.  Also,
> > don't all tags that care about body content have to implement BodyTag?
> Like
> > <tiles:put>?
> >
> > Thanks
> > David
> > ----- Original Message -----
> > From: "Cedric Dumoulin" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, October 03, 2001 4:05 AM
> > Subject: Re: Tiles: using tileContent inside another tile
> >
> >
> > >
> > >   Hi David,
> > >
> > >   Tiles --CAN-- be nested.
> > >
> > >   I sometime have error like yours when there is an exception in an
> > inserted
> > > jsp.
> > >   A common way to debug such problem is to test separately each inserted
> > Tile.
> > >   Also, this error can be throw if you try to insert Tiles inside
> > <iterator>
> > > tag, or inside body of any tag implementing 'BodyTag' (jsp1.1
> limitation).
> > > Fortunately, I think that only the <iterator> tag implements 'BodyTag'
> in
> > > Struts.
> > >
> > >    Cedric
> > >
> > > David Corbin wrote:
> > >
> > > > I'm using the tiles library, and I've been quite happy with up 'till
> > now.
> > > >
> > > > The following example is simplified--
> > > >
> > > > I have a a template, standardPage.jsp which consists of standard
> header
> > and
> > > > footer HTML, and expects a tile named body.  It uses
> <tiles:getAsString
> > > > name="body">.  Works great, an lets me deifne pages like this:
> > > >
> > > > <tiles:insert tempate="standardPage.jsp">
> > > >     <tiles:put name="body> content here </tiles:put>
> > > > </tiles:insert>
> > > >
> > > > Like a charm.
> > > >
> > > > Now, I find myself trying to do a page that is built by including a
> few
> > > > other pages, and no matter how I go out about, I'm getting an
> exception
> > > >
> > > > Can't insert page '/WEB-INF/include/portal/identity.jsp' : Illegal to
> > flush
> > > > within a custom tag java.io.IOException: Illegal to flush within a
> > custom
> > > > tag.
> > > >
> > > > This seems to indicate that you can't nest tiles.  Is this correct?
> > > >
> > > > David
> > >
> > >
> > >
> >
> >
> >

Reply via email to