Antonio,
Seems that the parameters I am trying to set in web.xml file have no effect at
all. What's even stranger is that if I misspell the parameter name, the server
still starts up correctly, without any complaints. If I do the same thing when
I specify the DefinitionsReader parameter, the server fails to startup and
throws errors about missing parameter.
Anyhow, here is my entry for the web.xml file:
<servlet id="Servlet_tiles">
<servlet-name>tiles</servlet-name>
<servlet-class>org.apache.tiles.web.startup.TilesServlet</servlet-class>
<init-param>
<param-name>
org.apache.tiles.factory.AbstractTilesContainerFactory
</param-name>
<param-value>
com.bluemartini.artisa.tiles.DbTilesContainerFactory
</param-value>
</init-param>
<init-param>
<param-name>
org.apache.tiles.definition.DefinitionsFactory
</param-name>
<param-value>
org.apache.tiles.definition.LocaleDefinitionsFactory
</param-value>
</init-param>
<load-on-startup>4</load-on-startup>
</servlet>
And I still see the WRONG Definitions factory in my logs:
2009-05-04 16:13:52,453 DEBUG [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.
kernel.Default (self-tuning)'] UrlDefinitionsFactory - Updating Tiles
definitions. . .
It just seems that the parameters are not being picked up, or being ignored.
So the solution of using the LocaleDefinitionsFactory in the parameter
explicitly does not work. I dont think I should need to do this anyway - if
the code in my custom TilesContainerFactory gets executed correctly, the
LocaleDefinitionsFactory will be created automatically, right?
protected LocaleDefinitionsFactory instantiateDefinitionsFactory(
Object context, TilesApplicationContext applicationContext,
TilesRequestContextFactory contextFactory, LocaleResolver resolver) {
return new LocaleDefinitionsFactory();
}
So again, the problem remains that the
org.apache.tiles.factory.AbstractTilesContainerFactory parameter is not taking
effect in the web.xml file.
Any further ideas?
Vibhore
--- On Mon, 5/4/09, Antonio Petrelli <[email protected]> wrote:
From: Antonio Petrelli <[email protected]>
Subject: Re: Support for reloading/refreshing Tile Definitions
To: [email protected]
Date: Monday, May 4, 2009, 8:56 PM
2009/5/4 Vibhore Anant <[email protected]>:
> Hi Antonio,
>
> No I haven't. Which leads me to my next question - in the tutorial on the
> Tiles website, it is mentioned that two classes - a DefinitionDAO and a
> DbTilesContainerFactory need to be implemented (which I have) for loading
> Tiles from a database. Are you suggesting that I implement a custom
> DefinitionsFactory as well? Or is the idea to set the existing
> LocaleDefinitionsFactory against the
> org.apache.tiles.definition.DefinitionsFactory
The second that you said, I suggest to use LocaleDefinitionsFactory.
> As you may have noted, in my web.xml file, I have not set any explicit
> DefinitionsFactory (I didnt know one was required).
Sorry, I did not notice that :-S do you think that the tutorial should be fixed?
And did you succeed in your task?
Antonio