Re: [Jersey] Binding resource to base uri
>> BTW: I made some refactoring and now two of my resources mapped to
>> methods in one class:
>>
>> @Path("/")
>> public class ProjectResource {
>>
>> @GET
>> @Path("/")
>
> Remove the above @Path and it will work.
>
>
>>
>> public Response getProjectsList(){}
>>
>> @GET
>> @Path("{project}/")
>> public Response getProject() {}
>>
>> }
>>
>> If getProjectList annotated with @Path("/"), like in this example, no
>> resource matched the "http://localhost/resource/" request. It is not a
>> problem for me, but I think this could be an issue, because jsr311
>> spec says "For the purposes of absolutizing a path against the base
>> URI , a leading '/' in a path is ignored and base URIs are treated as
>> if they ended in '/'."
>
> Yes, it is a bug, such an @Path declaration should be equivalent to their
> being no @Path declared. Could you log an issue?
Here it is:
https://jersey.dev.java.net/issues/show_bug.cgi?id=239
Best regards,
Saiid