Thanks Howard.  After sending it I wondered if I had got the name right...

----- Original Message ----- From: "Howard Lewis Ship" <[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Wednesday, September 28, 2005 7:46 PM
Subject: Re: How to use Localization through java in tapestry4


Nifty thing about annotations is that when you have just a single
attribute named "value", you can omit the "value=" part, thus:

@Message("key")
public abstract String messageForKey();

Note that it is @Message not @InjectMessage

Also note that @Message tries to be smart about mapping the method
name to a key, so all the following will return the same string:

@Message("message-for-key")
public abstract String messageForKey();

@Message
public abstract String messageForKey();

@Message
public abstract String getMessageForKey();



On 9/28/05, Adam Greene <[EMAIL PROTECTED]> wrote:
@InjectMessage(value="key")
public abstract String getKeyValue();

if you do this:

@InjectMessage(value="key")
public abstract String getKeyValue(String param1, int param2);

it will use MessageFormat and the params as the replacement values.

----- Original Message -----
From: "Anjali Abraham" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, September 28, 2005 3:55 AM
Subject: How to use Localization through java in tapestry4


> Hi All,
>            I need help on how access my Message key values from my
> .properties file in my java file and display those values in my drop > down
> box which is being implemented using PropertySelection.
> I use Tapestry4beta4 version.
> I think I Tapestry3, we have something like getMessage(Key) method, but
> that
> is being deprecated in Tapestry4 and something like @Message annotation
> need
> to be used.
> So please someone can explain me what codes need to be added in my java
> file
> as well as in my .page file.
>
> Please respond with solution,
> Thanks in advance,
>
> Regards,
> Anjali
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to