Hi Thiago,

I assume you mean on my SymbolSource contribution for 'tapestry.properties' .. Which should it be?

"before:*" so that it gets loaded first (to initialise correctly), or
"after:*" so it gets loaded last (to override other settings)

Since I'm getting kind of inconsistent behaviour, I am unsure how to test this.

Thanks, Paul.

On 30/01/2012 1:00 PM, Thiago H. de Paula Figueiredo wrote:
Hi!

Have you tried ordering (adding "before:*" or "after:*" in your contributions? It's an OrderedConfiguration, so order matters. Without specifying order constraints, there's no guaranteed contribution order.

On Sun, 29 Jan 2012 23:45:11 -0200, Paul Stanton <p...@mapshed.com.au> wrote:

Hi all,

I've seen in a few examples and posts that the way to configure tapestry from a properties file is to use contributeSymbolSource. I would like to configure tapestry firstly from a properties file and secondly hard-set a couple of values from AppModule.

I am doing the following:

public static void contributeSymbolSource(OrderedConfiguration<SymbolProvider> providers)
     {
providers.add("tapestryConfiguration", new ClasspathResourceSymbolProvider("tapestry.properties")); providers.add("applicationConfiguration", new ClasspathResourceSymbolProvider("application.properties"));
     }

public static void contributeApplicationDefaults(MappedConfiguration<String, Object> configuration)
     {
         configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
     }

public static void contributeFactoryDefaults(MappedConfiguration<String, Object> configuration)
     {
configuration.override(SymbolConstants.APPLICATION_VERSION, MAJOR_VERSION + "." + MINOR_VERSION); configuration.override(SymbolConstants.COMPRESS_WHITESPACE, "false"); configuration.override(SymbolConstants.MINIFICATION_ENABLED, "false");
     }

I have triple checked that the content of 'tapestry.properties' on the classpath is:

tapestry.production-mode=false
tapestry.file-check-interval=10 s

This is the value of the files in 'target/classes' as well as 'target/[project]/WEB-INF/classes'.

However, when I print out the symbol values on one of my pages I get:

tapestry.production-mode: true
tapestry.compress-whitespace: false
tapestry.combine-scripts: true
tapestry.compact-json: true
tapestry.enable-minification: false
tapestry.file-check-interval: 1 s

The obvious conclusion would be that the SybolProvider is not being used/loaded, however I do not see any exceptions in the logs.

And then, after a number of restarts deleting the 'target' directory each time, the correct settings are read.

Is there anything obviously wrong with what I'm doing, or some cache I need to be deleting?

Thanks, Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to