jresey restful GET方式 参数定义以及访问 问题!

来源:互联网 发布:淘宝店怎么快速升钻 编辑:程序博客网 时间:2024/06/04 23:32
@Path("DcsService")public class DcsService {@GET@Path("/flight/{id}")  @Produces(MediaType.APPLICATION_JSON)public DcsFlight getDcsById(@PathParam("id") String id){//@PathParam("name") String name){return name;}正常访问地址是:http://localhost:8080/dc/rest/DcsService/flight/sa我想放两个参数怎么放?  列如@Path("/flight/{id}/{name}")   ?如果能放两个参数,那怎么访问?  列如http://localhost:8080/dc/rest/DcsService/flight?id=xx & name=xx?我想问的就是,多个参数怎么定义和进行访问,求教大神,本人刚用这东西两天....
0 0
原创粉丝点击