tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Petrelli" <antonio.petre...@gmail.com>
Subject Re: Changing a tile "template" path in a ViewPreparer
Date Tue, 20 Jan 2009 08:39:05 GMT
2009/1/19 Ignacio de Córdoba <icordoba@skios.es>:
> I am trying to figure how to do this in tiles 2. I can't find that
> TilesAction class (I guess that's normal as Tiles has been separated from
> struts) so I am trying to change the template path o a tile using a
> ViewPreparer.
>
> My problem is that in the execute() method in the ViewPreparer I only get
> TilesRequestContext and AttributeContext objects. I can access to the
> session, request and attributes in the Tile, but I cannot get information
> about the tile itself and subsequently change the template path on it.

You're right, in Tiles 2.0.x you cannot change the template of a
definition. In Tiles 2.1.x it is possible to do it: in Tiles 2.1.1
there is the AttributeContext.setTemplate method that you can use.
Notice that it will change in Tiles 2.1.2, I'm working on it:
https://issues.apache.org/struts/browse/TILES-354
If you still want to use Tiles 2.0.x, you can use an action URL as a template.
If you want to try it, in Struts SVN there is an initial
implementation to replace the Struts-specific Tiles support classes:
http://svn.apache.org/repos/asf/struts/struts1/trunk/tiles2/

Antonio

Mime
View raw message