0

With following code, serviceIdSegment is null while serviceId is not null.

class MySubResource {

    @GET
    @Path("{serviceId: .+}")
    public Response readById(@PathParam String serviceId) {
        // serviceId is not null
        // why serviceIdSegment is null?
    }

    @PathParam("serviceId");
    private PathSegment serviceIdSegment;
}

Can anybody please tell me why?

Jin Kwon
  • 20,295
  • 14
  • 115
  • 184

1 Answers1

0

I noticed, when I tried to answer, that this question is mine.

The readById method is lazily evaluated after the root resource class is matched.

Jin Kwon
  • 20,295
  • 14
  • 115
  • 184