JAX-RS选项路径参数无效

时间:2013-01-29 18:47:36

标签: jax-rs

我正在尝试使用以下构造

@ApplicationPath("app")
@Path("api/{userid}/model")
public class ModelService
{
   @Get
   @Path("{modelid: (.*)?}")
   public Response removePreProcessor(@PathParam("userid") String sUserId, @PathParam("preprocessorid") String sPreProcessorId)
   {
       return Response.build();
   }
}

我无法访问以下REST URL

GET http://localhost:8080/XXXX/app/api/xyz/model
GET http://localhost:8080/XXXX/app/api/xyz/model/123

让我知道我在做什么是错的

- 提前谢谢

1 个答案:

答案 0 :(得分:1)

当我读到你的问题时,有些事情对我来说很奇怪,但它们可能与情境有关。

但有一件事似乎错了:

您正在使用@PathParam("preprocessorid"),但我无法在您的路径中看到此参数。

你有任何日志吗?

相关问题