Choose the code fragment that corresponds to a resource delegating processing of a request to a
subresource correctly, when processing the URL “/parent/child” (Choose one):
A.
@Path(“/parent”)
class Parent {
@Path(“/child”)
Child getChild() { return new Child(); }
}
class Child {
@GET String getName() { return “name”; }
}
B.
@Path(“/parent”)
class Parent {
@GET @Path(“/child”)
Child getChild() { return new Child(); }
}
class Child {
@GET String getName() { return “name”; }
}
C.
@Path(“/parent”)
class Parent {
@Path(“/child”)
Child getChild() { return new Child(); }
}
@Path(“/child”)
class Child {
@GET String getName() { return “name”; }
}
D.
@Path(“/parent”)
class Parent {
@Path(“/child”)
Child getChild() { return new Child(); }
}
class Child {
String getName() { return “name”; }
}
Explanation: