tags:

views:

14

answers:

1

How can I have a resource that is a composite so that a GET to it returns a list of GET to all its subresources so that they can accept a GET also?

Having two methods like @Path("students") and @Path("student") with @QueryParam doesn't fit what I'm looking for, which is that the composite resource is just a dumb container for heterogeneous resources.

A: 

If the resource has a method annotated with @Path, but no @GET, it is expected that the returned value is a resoruce (has @GET).

So something like (pseudocode):

@Path("resources")
class MyResource {
   var subs = Map[String, AnyRef]()

   @GET
   def get = ...

   @Path("{sub}") 
   def sub(@QueryParam("sub") sub: String) = subs(sub)
}    
IttayD