WARNING: The (sub)resource method contains empty path annotation

只谈情不闲聊 提交于 2019-12-03 22:16:46

The warning means you have a resource method annotated with @Path("/") or @Path(""). For instance

@Path("test")
public class Test {

    @GET
    @Path("/")
    public String test(){}
}

Not sure why Jersey would give a warning, maybe just to make sure that's what you really want. The reason is that a resource method with @Path("/") is redundant, as it's already implied if you were just to do

@Path("test")
public class Test {

    @GET
    public String test(){}
}

without the @Path("/"). It works the same. So if you have these, remove them, and it should take away the warnings.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!