You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Theodoridis <st...@tera.gr> on 2003/02/13 19:42:34 UTC
Action for each Tile?
Hi!
I have a main page and i use tiles. Some tiles are dynamic (take its context
from database).
Wich is the best solution?
1. Each tile to have its own action and define them at tiles-def.xml
2. To use Tiles only to display context and all data retreved from actions of
main pages?
At 1st solution is there any delay because executes more than one actions?
Theodoridis Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Action for each Tile?
Posted by Michael Hanisch <mh...@redhat.com>.
On Thu, 2003-02-13 at 19:42, Jim Theodoridis wrote:
> Hi!
Hi!
> I have a main page and i use tiles. Some tiles are dynamic (take its context
> from database).
>
> Wich is the best solution?
> 1. Each tile to have its own action and define them at tiles-def.xml
>
> 2. To use Tiles only to display context and all data retreved from actions of
> main pages?
Tiles Controllers will give you more flexibility - a Controller is
something like an Action that is invoked for a single tile.
See http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf
and http://blogs.browsermedia.com/patrick/index.do?date=20030212 for a
good introduction.
The tile's controller can do a DB query or whatever to retrieve the data
and pass it to the tile, without interfering with your Action.
So I guess this would fit your solution #1; #2 should be OK as well, but
introduces more dependencies between tiles and Actions.
> At 1st solution is there any delay because executes more than one actions?
Probably, though it should be negligible. I mean, the more lines of code
are executed, the longer it takes ;-)
But still the added flexibility and loose coupling between tiles and
Actions is worth it.
HTH,
Michael.
--
Michael Hanisch mhanisch@redhat.com
Red Hat - RH Interchange Inc., Orleansstrasse 4, D-81669 Munich/Germany
phone: +49 (0)89 206058-53 fax: +49 (0)89 206058-88
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org