users@jersey.java.net

RE: [Jersey] several QueryParams ?

From: Herak Sen <HSen_at_vertrax.com>
Date: Wed, 9 Sep 2009 09:13:33 -0400

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