users@jersey.java.net

Re: Get all *parameters on, both, Properties or Map<String, String>

From: Jose Antonio Illescas del Olmo <jose.illescas_at_gmail.com>
Date: Wed, 9 Jan 2008 13:30:10 +0100

On Jan 9, 2008 12:47 PM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:

> Jose Antonio Illescas del Olmo wrote:
> >
> > with current-empty-value annotation
> >
> > public void get(@*URIParam("")* Properties params)
> >
> > or with new non-value annotations
> >
> > public void get(@*AllURIParam**s* Map<String, String> params)
> >
>
> You can do this with the UriInfo class [1]:
>
> public void get(@HttpContext UriInfo uriInfo) {
> MultivaluedMap<String, String> params =
> uriInfo.getTemplateParameters();
> }
>
> which can also be used to obtain all the query parameters. You can use
> the HttpHeader class for obtaining all the HTTP request headers.
>
> Does that work for you?


Can work... (thank you)

Then a MessageBodyWriter only receive (in writeTo method) a header param as
MultivaluedMap.

    Can't access to HTTPHeaders (to their cookies) or UriInfo? (to allows
that Producer, or Consumer, check it)



>
>
> Paul.
>
> [1]
>
> https://jsr311.dev.java.net/nonav/releases/0.5/javax/ws/rs/core/UriInfo.html
>
> --
> | ? + ? = To question
> ----------------\
> Paul Sandoz
> x38109
> +33-4-76188109
>