0

I have a class called InjectDemoResource in which I have created a method getParam() which is as belowenter image description here

As you can see I have set the path to /injectdemo and /annotations, I used the the @MatrixParam annotation in the getParam() method.

I am using Rest API client - Postman in which i typed the URL in the following way:

http://localhost:8080/Messenger/webapi/injectdemo/annotations:param=value

But I got the following error : 404 Not Found enter image description here

scriobh
  • 868
  • 10
  • 25
  • Use `;` instead of `:`. – cassiomolin Feb 22 '17 at 22:20
  • Try using this URL http://localhost:8080/Messenger/webapi/injectdemo/annotations;param=value – alayor Feb 22 '17 at 22:21
  • Please read [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) before attempting to ask more questions. Do not post code as images! –  Apr 11 '17 at 20:23
  • Please see [Why may I not upload images of code when asking a question on Stack Overflow?](https://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-on-so-when-asking-a-question/285557) – EJoshuaS - Stand with Ukraine Apr 11 '17 at 20:58

2 Answers2

2

Use ; instead of : in the URL:

http://localhost:8080/Messenger/webapi/injectdemo/annotations;param=value

For more details, on how matrix params work, check the RFC 6570:

3.2.7. Path-Style Parameter Expansion: {;var}

Path-style parameter expansion, as indicated by the semicolon (;) operator [...], is useful for describing URI path parameters, such as path;property or path;name=value. [...]

Community
  • 1
  • 1
cassiomolin
  • 124,154
  • 35
  • 280
  • 359
1

This will fix the error.

http://localhost:8080/Messenger/webapi/injectdemo/annotations;param=value

Make sure that you are placing a semicolon ( ; ) in your URI after /annotations

coderpc
  • 4,119
  • 6
  • 51
  • 93