Hi,
Check out this page: http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html
Especially the section regarding dealing with parameters. As a quick
answer to your question, modify your method annotation as follows:
@POST
@Path("/addStrs/{str1}/{str2}")
public String addStrs(@PathParam("str1") String str1,
@PathParam("str2") String str2);
Hth.
Gabo
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.
@POST
@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
------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.9.0/1778 - Release Date: 11/9/2008 2:14 PM