Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/rest/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在jersey1中@PathParam后面可以有尾随字符串吗?_Java_Rest_Jersey - Fatal编程技术网

Java 在jersey1中@PathParam后面可以有尾随字符串吗?

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) { ... } 我在启动时会遇到这样的错误

在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) {
    ...
}
我在启动时会遇到这样的错误

Illegal URI template for sub-resource method ... getFooBar(...): Illegal character '/'
@PathParams
之后有尾随数据合法吗?

尝试以下方法:

@GET @Path("/root/{someID}/bar/{bar}")

我看你的代码没有问题。这是您使用的真实代码吗?我正在使用jersey1.14@Path(“ex/{id1}/EE”)正在工作。哎呀,我缺少一个右括号。