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: Freemarker and TIles PutAttribute
Date Thu, 02 Apr 2009 21:17:45 GMT
2009/4/1 Amin Mohammed-Coleman <aminmc@gmail.com>:
> java.lang.IllegalArgumentException: Cannot find a factory to create
> the request context

This is because you've not configured a Tiles request context factory
for FreeMarker.

> Looking at the test tiles from svn I can see a testtileslistener which
> extends tileslistener. I need to configure a listener in my web.xml
> however the test contains quite a number of other classes which I
> don't know if I need.  Is there a extended tileslistener that I can
> use?

You have two choices:
1) using parameter-based initialization, by setting this parameter:
http://tiles.apache.org/framework/config-reference.html#org.apache.tiles.context.ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES

2) Using pure Java configuration:
http://tiles.apache.org/framework/tutorial/configuration.html#Startup_with_Java_code
http://tiles.apache.org/framework/tutorial/configuration.html#Pure_Java_configuration

In particular you have to override this method of BasicTilesContainerFactory:
http://tiles.apache.org/framework/apidocs/org/apache/tiles/factory/BasicTilesContainerFactory.html#registerChainedRequestContextFactories(org.apache.tiles.context.ChainedTilesRequestContextFactory)

HTH
Antonio

Mime
View raw message