You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Kolesnikov, Alexander GNI" <Al...@CIGNA.com> on 2007/09/10 13:03:50 UTC

Trying to read tapestry.supported-locales

I am trying to read the value of tapestry.supported-locales in the code
and display it in an expansion. Tried like so:

public String getLocaleNames(@InjectService
("tapestry.supported-locales") String localeNames) {
	return localeNames; 
}

And like so:

public String getLocaleNames(@Inject
@Symbol("tapestry.supported-locales")  String localeNames) {
	return localeNames; 
}

In both cases, Tapestry complains that

Class ... does not contain a property named 'localeNames'.
Is there a way to do what I want?
Thanks,
Alexander 


------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown.  This email transmission may contain confidential information.  This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly.  Please delete it from your files if you are not the intended recipient.  Thank you for your compliance.  Copyright 2007 CIGNA
==============================================================================

Re: Trying to read tapestry.supported-locales

Posted by Davor Hrg <hr...@gmail.com>.
you can not use Inject in the getter
firstly because it is not a getter method if it has parameters,
and secondly because you can use inject only for page variables,
injecting inside methods only works inside you AppModule class

change your code:

@Inject @Symbol("tapestry.supported-locales")
private String localeNames;

public String getLocaleNames() {
       return localeNames;
}

will the @Symbol provide the value you need, I don't know,
I haven't used this case.

Davor Hrg

On 9/10/07, Kolesnikov, Alexander GNI <Al...@cigna.com>
wrote:
>
> I am trying to read the value of tapestry.supported-locales in the code
> and display it in an expansion. Tried like so:
>
> public String getLocaleNames(@InjectService
> ("tapestry.supported-locales") String localeNames) {
>         return localeNames;
> }
>
> And like so:
>
> public String getLocaleNames(@Inject
> @Symbol("tapestry.supported-locales")  String localeNames) {
>         return localeNames;
> }
>
> In both cases, Tapestry complains that
>
> Class ... does not contain a property named 'localeNames'.
> Is there a way to do what I want?
> Thanks,
> Alexander
>
>
>
> ------------------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: If you have received this email in error, please
> immediately notify the sender by e-mail at the address shown.  This email
> transmission may contain confidential information.  This information is
> intended only for the use of the individual(s) or entity to whom it is
> intended even if addressed incorrectly.  Please delete it from your files if
> you are not the intended recipient.  Thank you for your
> compliance.  Copyright 2007 CIGNA
>
> ==============================================================================
>