No, getMessage(locale, "key") searchs for the italian file first. If it don't find it, 
it will take the default file.

Regards,

Frank



-----Ursprüngliche Nachricht-----
Von: Paul McCulloch [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 16. Januar 2004 13:02
An: 'Struts Users Mailing List'
Betreff: RE: Access Applicationresources.properties from Action


Is there an easy way to get the 'closest match' on terms of locales in the
request?

For example, my browser has it's request languages set to
Italian;French;English. My application's default properties file is in
English. There is a French properties file but not an Italian one.

So, when I ask for a value I want to get the French one. But getMessage()
will always return a value if the key exists in the default locale, so there
seems to be no way to try Italian first, then French, then English.

Any ideas?

Paul

> -----Original Message-----
> From: Otto, Frank [mailto:[EMAIL PROTECTED]
> Sent: 16 January 2004 11:46
> To: 'Struts Users Mailing List'
> Subject: AW: Access Applicationresources.properties from Action
> 
> 
> Hi Eric,
> 
> use:
> 
> MessageResources resources = 
>                    
> (MessageResources)request.getAttribute(Globals.MESSAGES_KEY);
> String msg = resources.getMessage(locale, "key");
> 
> 
> Regards,
> 
> Frank
> 
> -----Ursprüngliche Nachricht-----
> Von: Eric C [mailto:[EMAIL PROTECTED]
> Gesendet: Freitag, 16. Januar 2004 12:42
> An: Struts Users Mailing List
> Betreff: Access Applicationresources.properties from Action
> 
> 
> Hi all,
> 
> i'd like to access my properties file from the Action. My 
> purpose is deliver
> an error message to my result page. Any sample code showing 
> the use of the
> MessageResources object ?
> 
> Regards,
> ERic
> 
> 
> ---------------------------------------------------------------------
> 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]
> 


**************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.


---------------------------------------------------------------------
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