2017-02-22 72 views
-1

我有一个叫InjectDemoResource类中,我创建了一个方法getParam()是如下enter image description hereREST API矩阵PARAM注释

正如你可以看到我已经将路径设置为/injectdemo/annotations,我用的@MatrixParam注释在getParam()方法。

我使用REST API客户端 - 邮差中,我输入的网址按以下方式:

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

但我得到了以下错误:404 Not Found enter image description here

+0

使用';'而不是':'。 –

+0

尝试使用此URL http:// localhost:8080/Messenger/webapi/injectdemo/annotations; param = value – alayor

+0

请阅读[我如何问一个好问题?](http://stackoverflow.com/help/how-询问),然后尝试提出更多问题。不要将代码发布为图片! –

回答

1

使用;而不是:在URL中放置semicolon (;)在您的URI:

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

有关详细信息,矩阵PARAMS如何工作,检查RFC 6570

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

路径风格参数扩展,由分号(;) 操作者所指示的[...],是用于描述的URI 路径参数,诸如path;propertypath;name=value有用。 [...]

0

这会修正这个错误。

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

确保你后/annotations