Java 在jersey1中@PathParam后面可以有尾随字符串吗?
在jersey-1应用程序中,我有一个资源注释为:Java 在jersey1中@PathParam后面可以有尾随字符串吗?,java,rest,jersey,Java,Rest,Jersey,在jersey-1应用程序中,我有一个资源注释为: @GET @Path("/root/{someID}/bar") public FooBar getFooBar(@PathParam("someID") String fooID) { ... } @GET @Path("/root/{someID}/baz") public FooBaz getFooBaz(@PathParam("someID") String fooID) { ... } 我在启动时会遇到这样的错误
@GET @Path("/root/{someID}/bar")
public FooBar getFooBar(@PathParam("someID") String fooID) {
...
}
@GET @Path("/root/{someID}/baz")
public FooBaz getFooBaz(@PathParam("someID") String fooID) {
...
}
我在启动时会遇到这样的错误
Illegal URI template for sub-resource method ... getFooBar(...): Illegal character '/'
在@PathParams
之后有尾随数据合法吗?尝试以下方法:
@GET @Path("/root/{someID}/bar/{bar}")
我看你的代码没有问题。这是您使用的真实代码吗?我正在使用jersey1.14@Path(“ex/{id1}/EE”)正在工作。哎呀,我缺少一个右括号。