tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pauli Savolainen" <savolainen.pa...@gmail.com>
Subject Re: Struts 2 Tiles 2 Runtime composition
Date Thu, 28 Feb 2008 20:37:10 GMT
2008/2/28, Antonio Petrelli <antonio.petrelli@gmail.com>:
> 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:
>  http://tiles.apache.org/tutorial/advanced/preparer.html
>  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:
>  http://tiles.apache.org/2.0/framework/apidocs/org/apache/tiles/context/TilesRequestContext.html
>  The "getRequest" method returns the original HttpServletRequest.
>
>  HTH
>
> Antonio
>

Hi,

Thank you very much. I got it working with a little tweaking. I
inspect the url in the view preparer and include a body content
according to it. Works nice.

Pauli

Mime
View raw message