With Tiles you need one body for each page, and a definition specifying how the page is built. These definitions can be specified in one centralized file. Furthermore, there is an "extends" capability avoiding unnecessary repetitions. The problem is that you need to associate a definition to an URL. This can be done in a jsp page (but you need again a second jsp) or by using a Struts action. In this later case, you can choose between one action for each page, or one action dispatching the request to appropriate definition according to an http parameter.
The <insert> tag behaves like a method call: you can pass parameters (called attributes) that will be local to the inserted tiles. These parameters will not interfere with other parameters with the same names declared in a surrounding tiles. You can't do that with a jsp:include. This allows to reuse a tiles several time in the same page, a different level. It also allows to develop tiles without worrying about attribute name clashing.
Cedric
Marcus Biel wrote:
Hi Cedric,
I just had a look at Chuck's chapter about tiles.
I didn't read the whole chapter yet, only the half,
but from what I've read so far, it doesn't seem to be so different from
templates,
just gots some enhanced features.
Btw: I also read that it was you who created it! :-)
So you should be the perfect person to ask about tiles:
I still can't see a reason to use tiles instead of a simple include
file.
I mean, okay, you can easily change your entire layout. BUT -
in return you got twice as much files!
For each file you need a content.jsp and a content-body.jsp.
It might be useful to easily change your entire layout -
but imho in the majority of cases you always got the same header and
footer,
and you'r unlikly going to put your copyright footer at the top of you
pages or your header at the bottom.
If your just including header and footer, you got much less pages to
create and to administrate, in contrast
to a minor drawback that you can't easily put your footer at the top of
your page.
Correct me if I am wrong.
Marcus
[EMAIL PROTECTED] schrieb:
Hi,--
You can use tiles in 1.02. You need to use the separate
tilesForStruts1-0.jar file. You can find it in the distrib from the
original tiles site. Then check under lib/tiles1.0.
Cedric
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>
-- To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>