users@jersey.java.net

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

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 09 Jan 2008 14:00:14 +0100

Jose Antonio Illescas del Olmo wrote:
>
>
> On Jan 9, 2008 12:47 PM, Paul Sandoz <Paul.Sandoz_at_sun.com
> <mailto: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)
>

Correct. In 0.5 the reader/writer components are statically scoped.

For 0.6 we will be changing this so they will be web application scoped
(i.e. scoped per WebApplication instance) and then it will be possible
to inject fields on readers/writers.

I want to also make it so that instantiation can be deferred to an
registered IoC framework (like we do for resource classes).

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109