With JAX-RS you can inject
@Contex HttpHeaders headers

as a parameter and then do headers.getLanguage()

assuming you're using Accept-Language parameter

Alternatively, if you have a request Accept header set like this :

Accept : application/json;charset=value1 then you can do
List<MediaType> types = headers.getAcceptableMediaTypes();

and then for every MediaType you can do
type.getParameter("charset")


Cheers, Sergey


----- Original Message ----- From: "Benson Margulies" <[EMAIL PROTECTED]>
To: <[email protected]>; <[EMAIL PROTECTED]>
Sent: Friday, June 13, 2008 12:19 PM
Subject: Re: Rest Service & Local


Add it as a parameter.

On Fri, Jun 13, 2008 at 2:32 AM, Coder One <[EMAIL PROTECTED]> wrote:

My REST calls need to deal with locale.  What's the recommended way to
obtain a locale setting from the client?

Thanks,









----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to