Hi

Try to inject ComponentResources into your page, call getMessages(), this
will build a new Catalog hierarchy as you describe.
If you want to obtain this from a service, use ComponentSource service to
obtain an instance of page (implements Component), then call
getComponentResources() and then getMessages()

Regards,
Christophe.

Developer of Wooki @wookicentral.com

2010/2/5 Christoph Jäger <christoph.jae...@polleninfo.org>

> Hi,
>
> just found something that leads in the right direction, see below.
>
>
>
>  Have a look at
>>> http://tapestry.apache.org/tapestry5/tapestry-ioc/parallel.html
>>>
>>
>> This document describes a mechanism for running threads. I will probably
>> use some Spring functionality for scheduling my threads, so this part is
>> already handled. The only thing missing is how to get hold of a Messages
>> instance for a given Locale and a given class, without being a Tapestry page
>> and relying on injection? Is there a way to let Tapestry inject this
>> Messages instance into my Spring managed classes? Or is there something like
>> MessagesUtil.getMessages(Locale locale, Class clazz) to request the
>> appropriate Messages instance from Tapestry?
>>
>
> I can request a Messages instance like this:
>
>  Locale.setDefault(new Locale("de"));
>  Messages messages = MessagesImpl.forClass(MyClass.class);
>
> This gives me a "german speaking" Messages instance using the translations
> defined in MyClass_de.properties.
>
> Almost there! The Messages instance injected into my pages by Tapestry uses
> the "master" properties file MyApp_de.properties and MyApp.properties if it
> does not find a key in MyClass_de.properties, but my "manually" created
> Messages instance does not. How can I improve it to behave like the
> Tapestry-injected instances?
>
> Thanks,
>
>
> Christoph Jäger
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Developer of wooki @wookicentral.com

Reply via email to