You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by José Paumard <Jo...@orange.fr> on 2008/09/30 11:10:02 UTC
Available locales
Hello all,
I defined a set of available locales in my AppModule class, and it works
fine. In a component or a page class, when I use :
@Inject @Symbol("tapestry.supported-locales")
private String supportedLocales ;
the string I get is correct.
Now what I would like to get is a List<Locale> rather than a string with
a coma separated list of ISO codes, so I made a service :
public class MyLocaleServiceImpl implements MyLocaleService {
@Inject @Symbol("tapestry.supported-locales")
private String availableLocales ;
public List<Locale> getSupportedLocales() {
...
}
}
... but the availableLocales value is null in that case. Is it supposed
to work like or is it a bug ?
Thank you,
José
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Available locales
Posted by "Blower, Andy" <An...@proquest.co.uk>.
I think that you need to inject the symbol as an argument to your service's constructor using a build method in your module.
> -----Original Message-----
> From: José Paumard [mailto:Jose.Paumard@orange.fr]
> Sent: 30 September 2008 10:10
> To: users@tapestry.apache.org
> Subject: Available locales
>
> Hello all,
>
> I defined a set of available locales in my AppModule class, and it
> works
> fine. In a component or a page class, when I use :
>
> @Inject @Symbol("tapestry.supported-locales")
> private String supportedLocales ;
>
> the string I get is correct.
>
> Now what I would like to get is a List<Locale> rather than a string
> with
> a coma separated list of ISO codes, so I made a service :
>
> public class MyLocaleServiceImpl implements MyLocaleService {
>
> @Inject @Symbol("tapestry.supported-locales")
> private String availableLocales ;
>
> public List<Locale> getSupportedLocales() {
> ...
> }
> }
>
> ... but the availableLocales value is null in that case. Is it supposed
> to work like or is it a bug ?
>
> Thank you,
>
> José
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org