Hi Martin,
sorry for late reply. I was busy the last two days. I have tried the
solution you suggested and indeed it just works. That was realy easy!
Not having found the solution myself after digging into the sources, I
have to admit that I'm feeling a bit stupid now.
Thanks a lot, for your solution (and for making me feel stupid),
nillehammer
Am 17.06.2011 01:41, schrieb Martin Strand:
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
--
http://www.winfonet.eu
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org