@PathParam 和 @QueryParam 有什么区别 [英] What is the difference between @PathParam and @QueryParam

查看:23
本文介绍了@PathParam 和 @QueryParam 有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 RESTful 球衣的新手.请问jersey中的@PathParam@QueryParam有什么区别?

I am newbie in RESTful jersey. I would like to ask what is the different between @PathParam and @QueryParam in jersey?

推荐答案

查询参数在?标记之后添加到url,而路径参数是常规URL的一部分.

Query parameters are added to the url after the ? mark, while a path parameter is part of the regular URL.

tom 下面的 URL 中可能是路径参数的值,并且有一个名为 id 和值 1 的查询参数:

In the URL below tom could be the value of a path parameter and there is one query parameter with the name id and value 1:

http://mydomain.com/tom?id=1

这篇关于@PathParam 和 @QueryParam 有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆