开发者

What does this strange Jersey warning mean?

What does this warning 开发者_运维技巧mean in Jersey 1.4:

WARNING: A sub-resource method, public final java.lang.String com.XXX.render(), 
with URI template, "/", is treated as a resource method

This is how the method looks:

@GET
@Produces(MediaType.APPLICATION_XML)
@Path("/")
public final String render() {
  return "test";
}


Why do you need specify such path for method? @Get is enough to tell jersey that it is default method for entire class (I'm assuming that your class has some @Path("/MyRes") annotation).


Looks like you had the same problem last week with How to route JAX-RS request conditionally, depending on the suffix? - any luck fixing it there?

A look around on the net reveals you may have set-up your constructor incorrectly - have a read through http://jersey.576304.n2.nabble.com/Problem-using-the-JerseyTest-class-td3256608.html - someone who had a similar problem and was able to resolve it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜