2011/9/9 Muneer Malik <[email protected]>
> 2011/9/9 Muneer Malik <[email protected]>
>>
>>> public class CustomTilesContainerFactory extends
>>> BasicTilesContainerFactory {
>>> ...
>>>
>>> do you want me to add the following in the above class;
>>>
>>> @Override121
>>> <http://tiles.apache.org/2.2/framework/tiles-extras/xref/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.html#121>
>>> *protected* BasicTilesContainer instantiateContainer(122
>>> <http://tiles.apache.org/2.2/framework/tiles-extras/xref/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.html#122>
>>> TilesApplicationContext applicationContext) {123
>>> <http://tiles.apache.org/2.2/framework/tiles-extras/xref/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.html#123>
>>> *return* *new* CachingTilesContainer();124
>>> <http://tiles.apache.org/2.2/framework/tiles-extras/xref/org/apache/tiles/extras/complete/CompleteAutoloadTilesContainerFactory.html#124>
>>> }
>>>
>>>
>>>
Exactly.
>
>>> and if I want to use Tiles API
>>>
>>> where that java code should go, in the same above class or a seperate class.
>>>
>>>
>>> I see the link which you suggested:
>>>
>>>
>>> MutableTilesContainer container = TilesAccess.getContainer(
>>> request.getSession().getServletContext());
>>> Definition definition = new Definition();
>>> definition.setTemplate("/layouts/my_layout.jsp");
>>> definition.putAttribute("body", new Attribute("/tiles/body.jsp");
>>> container.register(definition, request, response);
>>>
>>>
>>>
>>> where the above code should go?
>>>
>>>
For example at the end of a servlet call.
If you use a framework, then you can do it at the end of an
action/command/whatever, wherever you have access to the request/response
pair.
Antonio