users@jersey.java.net

Re: [Jersey] WadlGenerator does not generate resource methods for subresources?

From: Martin Grotzke <martin.grotzke_at_freiheit.com>
Date: Tue, 10 Jun 2008 16:53:52 +0200

On Tue, 2008-06-10 at 10:07 -0400, Marc Hadley wrote:
> On Jun 10, 2008, at 9:57 AM, Paul Sandoz wrote:
> >> On Tue, 2008-06-10 at 14:05 +0200, Paul Sandoz wrote:
> >>> Hi Martin,
> >>>
> >>> The main issue we do not know at compile/deploy time what concrete
> >>> resources are returned by sub-resource locater methods.
> >> You're speaking of the cases when resource methods simply return a
> >> Response instead of a concrete type?
> >
> > No a "sub-resource locator" not a "sub-resource method" :-) like the
> > sub-resource locator UsersResource.getUser.
> >
> > This method could in the future also return a sub-type of
> > UserResource, say PreferredUserResource with additional URI space,
> > say for a preferred paying user.
> >
> > I suppose if the return type of the sub-resource locator is
> > recognized as a resource we could do some processing on it even if
> > it is not always the concrete type returned.
> >
> I was going to suggest the same, that would at least give some
> baseline information.
Hmm, I don't really get what you have in mind. What does "additional URI
space" actually mean?

To me it looks like this:
- we have a root resource UsersResource with @Path("/users")
- this has a sub-resource locator "UsersResource.getUser" with
  @Path("{username}") that returns a UserResource
- The UserResource has the path "{username}" as context and several
  resource methods (UserResource.getUser, UserResource.updateUser
  etc.), sub-resource methods and sub-resource locators.

So the UserResource has the context path "/users/{username}" and all
resource methods, sub-resource methods and sub-resource locators of the
UserResource are related to this path.

I'd say we have all information that we need.

Why do we not know, what concrete resource classes are returned from a
sub-resource locator? UserResource is the return type of the
sub-resource locator and seems very concrete to me :)

What is the actual problem then? Probably I'm missing s.th. :)

Cheers,
Martin


>
> Marc.
>
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net