有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JAVAX@GET注释

我正在尝试从url获取ID,可能还有页面和限制。我现在所拥有的一切都不起作用,我也看不出我做错了什么。这是我目前拥有的

    @GET
    @Path("venue/{locationid}?limit={limit}&page={page}")
    @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
    @Consumes(MediaType.APPLICATION_JSON + ";charset=utf-8")
    public String locationDetail(@PathParam("locationid") String locationid,@QueryParam("limit") @DefaultValue("10") String limit,@QueryParam("page") @DefaultValue("1") String page ) throws IOException {
        return service.locationDetail(locationid,limit,page);   
    }

}

locationid是必需的,其他两个不是必需的,在没有给出时必须是它们的默认值。然而,当我查看控制台时,我得到了以下错误

failed to execute: javax.ws.rs.NotFoundException: Could not find resource for full path: ./venue/175?limit=1&page=1

有人知道怎么解决这个问题吗?谢谢


共 (0) 个答案