You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Tim T. Young" <Yo...@cat.com> on 2002/07/26 17:27:43 UTC

Conversion from templates (Struts 1.0.2) to Tiles

I am converting a couple of test pages from templates in Struts 1.0.2 to
use Tiles.  My question is, how do I do something like this:

 <definition name="definition1" path="/web/template.jsp">
      <put name="header"   value="/web/header.jsp" />
     <put name="content"  value="/web/content.jsp" />
     <put name="sidebar"  value="/web/sidebar.jsp" />
     <put name="footer"   value="/web/footer.jsp" />
</definition>

<definition name="definition2" extends="definition1">
     <put name="sidebar"   value="" />
</definition>

Can I use "extends" to turn the "sidebar" off?  From a couple of quick
tests this seems not to work (it tries to load a file called "" and
understandably fails)  The template stuff in Struts 1.0.2 was forgiving
enough to treat "" as nothing and would just return null or empty string or
something from the tag, not an error or anything.

Any info would be appreciated...
Tim


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Conversion from templates (Struts 1.0.2) to Tiles

Posted by Eddie Bush <ek...@swbell.net>.
You can tell tiles how loudly to complain about missing elements.  I 
can't think how to turn it right off (ignore="true" comes to mind - but 
don't quote me!) right now, but there is a way to say "hush!  I know, I 
know, I know!  Do as I say!"  Go check out Chuck's chapter on Tiles.  He 
gives good treatment to it - and I'm nearly certain he mentions how to 
acheive this.  Failing that, dig through the tiles-documentation sample 
war file.

Regards,

Eddie

Tim T. Young wrote:

>I am converting a couple of test pages from templates in Struts 1.0.2 to
>use Tiles.  My question is, how do I do something like this:
>
> <definition name="definition1" path="/web/template.jsp">
>      <put name="header"   value="/web/header.jsp" />
>     <put name="content"  value="/web/content.jsp" />
>     <put name="sidebar"  value="/web/sidebar.jsp" />
>     <put name="footer"   value="/web/footer.jsp" />
></definition>
>
><definition name="definition2" extends="definition1">
>     <put name="sidebar"   value="" />
></definition>
>
>Can I use "extends" to turn the "sidebar" off?  From a couple of quick
>tests this seems not to work (it tries to load a file called "" and
>understandably fails)  The template stuff in Struts 1.0.2 was forgiving
>enough to treat "" as nothing and would just return null or empty string or
>something from the tag, not an error or anything.
>
>Any info would be appreciated...
>Tim
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>