Hi there,
I have a FrontController in charge of dispatching requests to different
pages. I have integrated my web application with the tiles framework and it
works fine. However, recently I need to add an extra functionality to it,
which I need to be able to change the tiles Attributes at runtim. For this
purpose, I have created a filter which intercepts the incoming requests and
based on the URL, it places the right tile attribute's value into the
TilesContainer as follows:
TilesContainer container = TilesAccess.getContainer(
request.getSession().getServletContext());
AttributeContext attributeContext =
container.getAttributeContext(request,
response);
attributeContext.putAttribute(containerTilesPartName, new
Attribute(containerTilesPartPath));
using container.render method will produce the page, however, I want to
avoid using the render since it conflicts with the FrontController which has
to dispatch the request to the right destination.
When I place the attribute within the filter before calling the
chainFilter.filter it doesn't reflect the new value for the designated
attribute, I suspect somewhere at the middle the attribute I am setting ,is
overridden.
Filter ----> change the attribute --> FrontController ---> jsp page --> load
the template ---> display the page
I don't want to change it to the following by using container.render() ,
since I would loose the FrontController logics afterwards.
Filter -- > change the attribute --> container.render
Would be any way to OVERRIDE the template attributes at runtime and let the
rendering happens in the ordinary way?
Many thanks
Pooyan
<#> <#>
<#> <#>