Page 1 of 1

About Question enthuware.ocejws.v6.2.197 :

Posted: Sun May 18, 2014 1:19 am
by nickeasyuptech
Hi Frits,

For the third possible answer -

URL: /add&num1=6;num2=18

Resource method:
@GET
@Path("/add")
public String addlistMa(@MatrixParam("num1") int num1, @MatrixParam("num2") int num2){    return "" + (num1+num2); }


The explanation is -

A correct URL should look like: /add;num1=6;num2=18

Is that explanation correct?

It seems it should be /add?num1=6&num2=18

Re: About Question enthuware.ocejws.v6.2.197 :

Posted: Sun May 18, 2014 3:39 pm
by himaiMinh
If this is used /add?num1=6&num2=18, the parameters should be annotated with @QueryParam, not @MatrixParam.
That said,

Code: Select all

public String addlistMa(@QueryParam("num1") int num1, @QueryParam("num2") int num2){    return "" + (num1+num2); }
Please verify this.

Re: About Question enthuware.ocejws.v6.2.197 :

Posted: Sun May 18, 2014 10:00 pm
by nickeasyuptech
That makes sense, thanks a lot for your help!