Re: [Jersey] howto RESTfully relate resources?

From: <>
Date: Wed, 10 Feb 2010 08:38:13 -0600

Awesome! Another way to expose this (perhaps easier to implement?) might

public Response relateFoo(@QueryParam("fooUrl")
ResourceReference<FooResource> aRef) {
        FooResource r = aRef.getResource();


Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Sent by: Paul.Sandoz_at_Sun.COM
02/10/2010 08:09 AM
Please respond to


Re: [Jersey] howto RESTfully relate resources?

On Feb 9, 2010, at 7:15 PM, wrote:

Sorry for replying to my own post here, but I just had this idea related
to my previous post that I think is worth sharing.

        public Response relateFoo(@QueryParam("fooUrl") FooResource
aFooResource) {
                // the jersey container will process the fooUrl parameter
in order to come up with the FooResource parameter

I think this would be a nice addition to jersey and in line with the
HATEOAS ideas floating around. If resources are identified by uris, then
we should be able to consume a uri and map it back to a resource.

Does this make sense?


Would it be hard to do?

Hmm.... my guess moderately hard. Jersey will need the concept of an
internal request. Plus there are all sorts of edge cases like what to do
with filters and exceptions. It will likely take a couple of days to get
everything neat and tidy.

This issue is becoming a popular one so i feel obliged to take it on :-)
just not this week, next week!


Please consider the environment before printing this email and any

This e-mail and any attachments are intended only for the
individual or company to which it is addressed and may contain
information which is privileged, confidential and prohibited from
disclosure or unauthorized use under applicable law. If you are
not the intended recipient of this e-mail, you are hereby notified
that any use, dissemination, or copying of this e-mail or the
information contained in this e-mail is strictly prohibited by the
sender. If you have received this transmission in error, please
return the material received to the sender and delete all copies
from your system.