无论如何在球衣中指定我想要可变长度的路径?

例如

我想实现一种可处理例如以下网址:

/images/asdfu213/size;width=100;height=200/reflect;offset=2/rotate;angle=0.45/


这是一条可变长度的路径,因为用户可以在图像上追加其他操作,例如:

/images/asdfu213/size;width=100;height=200/reflect;offset=2/rotate;angle=0.45/shear;x=0.3/


无论如何,泽西岛上有实现这一目标的方法吗?

我试过了:

@Path("/{id}/{size}/{ops: .*}")
Response process(@PathParam("id)String id, @PathParam("size") PathSegment sizeSegment, @PathParam("op") PathSegment opsSegments)


但是所有矩阵参数都是条带化的,而opsSegments.getPath为空

也尝试过

@Path("/{id}/{size}/{ops: .*}")
Response process(@PathParam("id")String id, @PathParam("size") PathSegment sizeSegment, @PathParam("op") String opsSegments)


尽管保留了路径,但所有矩阵参数都被剥离

任何帮助,将不胜感激。

最佳答案

抱歉找到了答案,

您可以列出PathSegment的列表,例如:

process(@PathParam("ops") List<PathSegment> ops)


球衣足够聪明,可以为您处理。

这在api文档中!应该先阅读它。

10-01 03:28
查看更多