Scott,

> > In a velocity template + properties file the template specifies what
> > properties should be used where.  The template also defines what other
> > templates to include (as does jsp include).  With the Tiles approach
this
> > 'controller' functionality is removed from the template making the
template
> > more reusable.
>
> I don't think so.  You could easily write Tiles using velocity, with the
> velocity directives pulling information from an XML file / database etc.
>   At a raw level, Tiles isn't that complicated (unless I am missing
> something).

I am sure you could write a velocity directive that achieves this
functionality by pulling configuration data from an XML file.  It could then
use its config to include other velocity templates etc.  This is all that
Tiles does.  It is a very simple tool.

> > All Tiles does is provide a simple way to define what reusable tiles you
> > want on a particular page (tiles-def.xml) making composing pages from
> > components easy.
>
> But how does this work with Struts / Webwork?  If you are using
> portlets, then you would be best off using the portlets API (if it is
> ever released).  Else how do you have multiple actions in the page?
>
> I've written a custom dispatcher before (allowing multiple actions to
> run on one page) - but I'll save that for another email.
>
> So - what does Tiles give you?  If you have one 'Tile' that is the main
> page, and the rest are just utilies, then why not use sitemesh.
>
> Alternatively, if you have multiple independent actions in your page,
> you should be using a portlet approach anyhow.
>

The portlet API sounds as if it may be aimed at exactly this type of
functionality.  Bring it on!  But Tiles is simple and works now (at least
for the view).

> Another question - how do you re-use tiles pages?  You can use the same
> template with different data, but how do you re-use the data in
> different places?  They must depend on the decorator?  Ie, depend on
> being inside a table.

Reusing a tile in a different page is easy as it works conceptually the same
as a jsp include.  For example, I have defined a utility tile called
"vertical_side.jsp" which is configured with list of child Tiles.  It then
displays them all vertically placing a line between them

Reusing a tile mulitple times on the same page works as long as it is not
retrieving data from state (ie request or session).  However, if two
identical tiles on the same page accessed request state then they would
display exactly the same info.  This is actually how tiles usually access
their data.  An action places data into the request and they render it to
the page.

So yes,  re-using the data was a difficulty with Tiles when I used it with
Struts.  It makes the view flexible but the action that created the data is
not associated with the view at all.

But Webwork has the fantastic value stack to add 'scope' to request
attributes.  This means that your template may include two different actions
which retrieve different data but they each define the same "success" view.
Each action will pop itself on the stack so that when its success view is
rendered using WW tags it will use the correct values.

Webwork seems to make the whole concept much more powerful by adding scope
to page components.

> I agree completely.  Please let me know some more information on how you
> use Tiles - I've never had to use it, but maybe I should.

I am about to use Tiles with Webwork on a website this week.  I will post it
as an example as soon as I am able.

John.


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to