Thanks a lot for your message. I'll try with that method and post here the results. My IDE was mixing both tiles versions as Struts 2.1.6 comes bundled with Tiles 2.0.6. After removing it from the classpath I can now see that setTemplate() method. Thanks also for the warning about the change in template handling in future versions. I'll be waiting for it. (I prefer to work on 2.1 version and forget about linking back to struts as I used to do in struts1)
Regards, Ignacio Antonio Petrelli-3 wrote: > > 2009/1/19 Ignacio de Córdoba <[email protected]>: >> 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 > > -- View this message in context: http://www.nabble.com/Changing-a-tile-%22template%22-path-in-a--ViewPreparer-tp21551618p21560257.html Sent from the tiles users mailing list archive at Nabble.com.
