users@jersey.java.net

Re: [Jersey] Binding resource to base uri

From: ???? ????????? <sunsunich_at_gmail.com>
Date: Wed, 11 Mar 2009 13:33:40 +0300

2009/3/10 Paul Sandoz <Paul.Sandoz_at_sun.com>:
> Hi,
>
> I have been informed by our kindly in-resident expert on Servlet, Jan, that
> GF is conforming to the servlet specification.
>
> So it appears, if i understand your WebSphere set up correctly that
> WebSphere is not conforming to the Servlet specification.
>
> Paul.

Yes, you are right, it was an error in my configuration: to conform
Servlet spec it needed to set the
"com.ibm.ws.webcontainer.removetrailingservletpathslash" variable to
"true". (by default is false).
The problem resolved, thank you.

BTW: I made some refactoring and now two of my resources mapped to
methods in one class:

@Path("/")
public class ProjectResource {

@GET
@Path("/")
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 '/'."

Thanks again, it was unforgettable experience :)
Saiid