【发布时间】:2016-12-08 16:28:18
【问题描述】:
使用以下 REST 服务定义:
@GET
@Path("/selection/{typeAssignation}/{numeroEmploye}")
public Response obtenirChoixSecteurs(@PathParam("typeAssignation") String typeAssignation,
@PathParam("numeroEmploye") Long numeroEmploye,
@QueryParam("confirme") @DefaultValue("true") Boolean confirme)
使用此 URL 调用服务时:
<...>/selection/HEBDOMADAIRE/206862?confirme=true
Liberty v16.0.0.3 抛出 NumberFormatException 并且客户端收到 HTTP 404 返回码:
java.lang.NumberFormatException: For input string: "206862?confirme=true"
liberty v16.0.0.3 似乎无法为正确的 PathParams / QueryParams 分配正确的值,即使它能够根据 URL 选择正确的方法
相同的代码在 WAS v8.5.5.9 中运行良好
这是嵌入 Liberty 的 cxf 中的错误(与 WAS 中的 wink 相比)吗?
【问题讨论】:
-
我不建议在 url 中接收键入的值,我会将所有内容设置为字符串并在之后解析它。
-
您是否有理由不建议使用标准 REST API?投了反对票,因为这根本不能解决我的问题......
标签: java jax-rs websphere websphere-liberty