users@jersey.java.net

Get the slash as a resource path

From: exxos <ma2xfr_at_gmail.com>
Date: Fri, 28 Aug 2009 23:46:31 +0200

Hi,

I'm testing this source code:

@Path("/test")
public class TestResource {

    @Path("{path: /}")
    public TestSubResource getDelegateGet(@PathParam("path") String path)
{
        // this class to @GET
        return new TestSubResource(path);
    }
}

Bellow the results I get:

GET http://127.0.0.1:8080/service/test
returns 405
>> OK, normal behavior

GET http://127.0.0.1:8080/service/test/
returns 405
>> FAILD, we want to call the method getDelegateGet()

GET http://127.0.0.1:8080/service/test//
returns 200 = Call the method getDelegateGet() (with path equals to "/")
>> OK, normal behavior, but not expected...

Does it possible to catch the "/" (slash) as a resource path?

Regards,
exxos.