It seems like the CXF HttpHeadersImpl actually returns Content-Language and not 
Accept-Language.

This seems like an standard JAX-RS API miss.  If the response needs to be 
formatted by a locale, the rest code needs to extract and parses 
accept-language by itself.


--- On Fri, 6/13/08, Coder One <[EMAIL PROTECTED]> wrote:

> From: Coder One <[EMAIL PROTECTED]>
> Subject: Re: Rest Service & Local
> To: [email protected]
> Date: Friday, June 13, 2008, 3:03 PM
> It's interesting to note that per HTTP, Accept-Language
> lists a set of language with a "preference"
> value.
> 
> I wonder why the standard API does not do a String[]
> headers.getLanguages() with the array sorted by order of
> language preference...
> 
> Thanks...
> 
> --- On Fri, 6/13/08, Sergey Beryozkin
> <[EMAIL PROTECTED]> wrote:
> 
> > From: Sergey Beryozkin
> <[EMAIL PROTECTED]>
> > Subject: Re: Rest Service & Local
> > To: [email protected], [EMAIL PROTECTED]
> > Date: Friday, June 13, 2008, 10:00 AM
> > 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