The current implementation of Tiles doesn't allow to change dynamically the path/layout of a definition. This is an enhancement request.
A workaround is to have a struts action forwarding to different definitions, according to the path you want to use.
Another trick is to have a jsp/tiles used as indirection. This tile is used as the path of your definition. This tile do an insert with the path set from one of the attribute (as you suggested), and pass all others attribute.



Hope this help,


Cedric

Trevor Porter wrote:

I'm trying to figure out if it's at all possible to parameterize the template path for a tiles defintion dynamically at runtime while at the same time declaring the tile definitions from a config file. I understand that this is straightforward when declaring a tile definition within a JSP (<tiles:definition id="definitionName" page="<%layout%>">), but I want to use my tile definitions as ActionForwards, thus I need to declare them in a config file. This would be useful for scenarios where pages need to be laid out differently based on some key (such as user preference or browser type) but the struts-config file only knows of a single definition to forward to for a given action. For example, imagine the following struts-config action mapping:

<action path="/login"
type="LoginAction"
input="/index.jsp"
name="loginForm"
validate="true"
scope="request"> >
<forward name="success" path=".account.home"/> The forward path points to a tiles definition that renders the account home page. I would like to dynamically control which template layout page is used for this definition from within the LoginAction. Is this possible?



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to