About Question enthuware.ocejws.v6.2.197 :

Moderators: Site Manager, fjwalraven

Post Reply
nickeasyuptech
Posts: 29
Joined: Sat Jun 08, 2013 11:33 pm
Contact:

About Question enthuware.ocejws.v6.2.197 :

Post by nickeasyuptech » Sun May 18, 2014 1:19 am

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

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh » Sun May 18, 2014 3:39 pm

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.

nickeasyuptech
Posts: 29
Joined: Sat Jun 08, 2013 11:33 pm
Contact:

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

Post by nickeasyuptech » Sun May 18, 2014 10:00 pm

That makes sense, thanks a lot for your help!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests