ApplicationDefaults is only one of many SymbolProviders, you don't need to configure that specific SymbolProvider to set the supported locales. There are other options, including support for .properties files or system properties.

I prefer context parameters myself, everything should "just work" if you add it to web.xml like so:

<context-param>
  <param-name>tapestry.supported-locales</param-name>
  <param-value>en,de</param-value>
</context-param>

The ServletContextSymbolProvider will handle the rest for you.
I'm sure you're already doing this for other symbols, at least "tapestry.app-package" :)


On Fri, 17 Jun 2011 00:28:17 +0200, Nillehammer <tapestry.nilleham...@winfonet.eu> wrote:

Hi List,

I would like to replace the constant Strings in the method "contributeApplicationDefaults" in my AppModule. E.g. replace the following line:

configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en,de"); // don't like the "en,de" here. Would like to replace it.

with something configurable in a text file. I thought providing the values in web.xml either as context-param or as init-param for the TapestryFilter was a good idea.

My first try was to inject the Context service as additional parameter to the contribution method to get access to the context-params. That did not work. The parameter is null and Tapestry throws an exception. Same with ApplicationGlobals.

I then browsed through Tapestry's source code and found out that I could implement my own filter inheriting from org.apache.tapestry5.TapestryFilter. So my next try was to do that and override the method "protected void init(Registry registry )". My hope was to be able to do something sensible with the javax.servlet.FilterConfig that is returned by getFilter(). But I have no clue, what to do.

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

Reply via email to