【发布时间】:2017-03-07 14:58:43
【问题描述】:
我的 resteasy 端点接口声明如下:
@Path("/entity")
public interface EntitySearchEndpoint {
...
@GET
@Path("/search")
@Produces(MediaType.APPLICATION_JSON)
public Response search(@Context UriInfo ui);
...
}
现在我使用接口创建了代理客户端
ResteasyClient reClient = new ResteasyClientBuilder().build();
ResteasyWebTarget webTarget = reClient.target(URI.create("http://example.com"));
EntitySearchEndpoint entitySearchEndpoint = ncspAPIWebTarget.proxy(EntitySearchEndpoint.class);
现在我可以使用
调用服务了UriInfo ui = ???
Response response = entitySearchEndpoint.search(ui);
我的问题是如何创建 UriInfo 实例以仅包含所需的查询参数?
可能使用@Context UriInfo作为参数不正确,正确的方法是什么?
QueryParam 名称列表不受限制,允许任何名称...
【问题讨论】:
标签: jakarta-ee jax-rs resteasy