You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yann Lebreton <yl...@cj.com> on 2003/10/01 19:33:38 UTC
Tile philosophy ?
Where ever I read on tiles the structure for a main JSP page is given around using 3 pages. 1 for the layout, 1 for insertion, 1 for content.
example of insertion:
<tiles:insert definition=".layout.main">
<tiles:put name="body" value="/content/content.jsp" />
</tiles:insert>
Is this a necessity, is it the best convention ? What's preventing to use only 2 pages: 1 for layout, 1 for insertion?
example of 2 page:
<tiles:insert definition=".layout.main">
<tiles:put name="body">
here goes <b>whatever</b> body you had in mind...
</tiles:put>
</tiles:insert>
Thanks for input,
Yann
Re: Tile philosophy ?
Posted by Manish Singla <Ma...@Sun.COM>.
You may want to have three pages (as suggested by you in first strategy)
to reuse tiles. If well defined, a Tile can be reused in different
locations.
Tiles-def.xml may grow exponentially if html pages are defined in that.
Different JSP pages lead to seperation of concerns
If requirement is to just send a "String or number" "(in second
strategy) than you may parameterize Tiles by specifying dynamic
attributes. There are tiles custom tages to support parameters.
Yann Lebreton wrote:
> Where ever I read on tiles the structure for a main JSP page is given around using 3 pages. 1 for the layout, 1 for insertion, 1 for content.
>
> example of insertion:
> <tiles:insert definition=".layout.main">
> <tiles:put name="body" value="/content/content.jsp" />
> </tiles:insert>
>
>
> Is this a necessity, is it the best convention ? What's preventing to use only 2 pages: 1 for layout, 1 for insertion?
>
> example of 2 page:
> <tiles:insert definition=".layout.main">
> <tiles:put name="body">
> here goes <b>whatever</b> body you had in mind...
> </tiles:put>
> </tiles:insert>
>
> Thanks for input,
> Yann
>
--
Thanks
Manish Singla
x73166
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org