users@jersey.java.net

Re: [Jersey] several QueryParams ?

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Wed, 9 Sep 2009 15:14:48 +0200

very nice.. now I am here thinking about validation, if Jersey will
detect an invalid parameter if it is not declared in the method.. and
then perhaps it is a good idea to type a bit more :)

On Wed, Sep 9, 2009 at 3:13 PM, Herak Sen<HSen_at_vertrax.com> wrote:
> Hi ,
>
>
> You can use the UriInfo to get the query params.
>
>
>        @POST
>        @Produces( { MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
>        public PujInstitutionEntity update(@Context UriInfo uriInfo) {
>
>                        MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters();
>                        String name = queryParams.getFirst("name ");
>
>                        // .. code here----
>
>        }
>
> Hope this helps
>
> Herak
>
> -----Original Message-----
> From: Felipe Gaścho [mailto:fgaucho_at_gmail.com]
> Sent: Wednesday, September 09, 2009 9:04 AM
> To: users_at_jersey.dev.java.net
> Subject: [Jersey] several QueryParams ?
>
> is there a more reasonable way of receive a set of query parameters
> than enumerating them in the method signature?
>
>        @POST
>        @Produces( { MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
>        public PujInstitutionEntity update(@QueryParam("name") String acronym,
>                        @QueryParam("name") String name,
>                        @QueryParam("name") String website,
>                        @QueryParam("name") String logo, @QueryParam("name") String email,
>                        @QueryParam("name") String contact, @QueryParam("name") String phone) {
>
>                // .. code here----
>        }
>
> --
> Looking for a client application for this service:
> http://fgaucho.dyndns.org:8080/footprint-service/wadl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>



-- 
Looking for a client application for this service:
http://fgaucho.dyndns.org:8080/footprint-service/wadl