cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aji John" <>
Subject Re: [JAX-RS] Can't get passing multiple parameters to work
Date Sat, 08 Nov 2008 18:39:08 GMT
 Try this, they are passed as a Map

 public String addStrs(MultivaluedMap<String, String> parameters)

     String str1 = parameters.getFirst("str1");

If my understanding is correct, @PathParam injections are avaliable only on
HTTP GET method.

On Fri, Nov 7, 2008 at 10:15 PM, guofoo <> wrote:

> I've searched and read all the posts related to multiple parameters but
> still
> can't seem to find a good working example or even whether it is possible or
> not? Some posts claim JAX-RS supports multiple parameters yet others claim
> it only supports 1 parameter. Maybe I'm missing something. Any help would
> be
> appreciated.
> @Path("/addStrs")
>    public String addStrs(@PathParam("str1") String str1,
>                @PathParam("str2") String str2);
> I have the method above, and I'm passing two strings in the POST data, but
> no matter what I use to delimit them, (, or ; or / ) they are always passed
> in as a single value for "str1" only and str2 is always empty. I've tried
> various combinations of the @Path such as @Path("/addStrs/{str1}/) which
> works the same as above, or @Path("/addStrs/{str1}/{str2}/) which always
> gives "No operation matching request path.." exception.
> I was hoping to get this working first, before attempting to pass other
> more
> complex object types besides String, but I can't even get past this simple
> case. Can someone tell me whether the above is possible? Is it the
> annotation that could be wrong or is it the way I'm passing the parameters
> from the client?
> Any pointers to examples would be appreciated as well, since I've looked
> through both the CXF examples but didn't find anything similar.
> -GF
> --
> View this message in context:
> Sent from the cxf-user mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message