Java Jersey路径参数:多个反斜杠分隔的参数

Java Jersey路径参数:多个反斜杠分隔的参数,java,rest,jersey,jersey-2.0,path-parameter,Java,Rest,Jersey,Jersey 2.0,Path Parameter,上述注释可用于将myValue检索到url的路径,如/assetViewCount/myValue 如何从路径中的/assetViewCount/myValue/nextValue获取myValue/nextValue您可以在路径中使用如下嵌入参数: @Path("/assetViewCount/{path}") 实际上,我找到了问题的解决方案,下面的注释给出了/assetViewCount/into{path}之后的所有内容 @Path("/assetViewCount/{path}/nex

上述注释可用于将myValue检索到url的路径,如/assetViewCount/myValue


如何从路径中的/assetViewCount/myValue/nextValue获取myValue/nextValue

您可以在路径中使用如下嵌入参数:

@Path("/assetViewCount/{path}")

实际上,我找到了问题的解决方案,下面的注释给出了/assetViewCount/into{path}之后的所有内容

@Path("/assetViewCount/{path}/nextValue")

你能提供一些真实的例子吗?您是否正在尝试查找返回两种不同
事物的
assetViewCount
。这两个值之间有关系吗?不是两个不同的东西,基本上这个${path}可以是一个文件路径,比如myFolder/subFolder/myFile.ext对于像/assetViewCount/myValue/nextValue这样的url,它会在{path}中给我myValue,但是我期望的是在/assetViewCount之后出现的任何东西它确实需要是
@Path(“/assetViewCount/{Path}/{nextValue}”)
@Path("/assetViewCount/{path:.*}")