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: Struts 2 Tiles 2 Runtime composition
Date Thu, 28 Feb 2008 14:52:53 GMT
2008/2/28, Pauli Savolainen <savolainen.pauli@gmail.com>:
>  In the action I want to choose a correct body value based on some
>  application specific rules. For example if I call:  /user/1, the User
>  action's show method is executed and the body attribute's value would turn
>  into /user/show.jsp. This would prevent me from writing definitions for each
>  possible case.

You could use a ViewPreparer:
You can use the AttributeContext object passed as a parameter in the
"execute" method and override the "body" attribute.
To know the calling URL, look at the TilesRequestContext:
The "getRequest" method returns the original HttpServletRequest.


View raw message