users@jersey.java.net

Re: [Jersey] Interlinking resources

From: Imran M Yousuf <imran_at_smartitengineering.com>
Date: Thu, 26 Mar 2009 19:41:18 +0600

On Wed, Mar 25, 2009 at 8:18 PM, Marc Hadley <Marc.Hadley_at_sun.com> wrote:
> On Mar 25, 2009, at 6:15 AM, Imran M Yousuf wrote:
>>
>> I have a generic REST question and am wondering how to achieve it in
>> using JAX-RS and Jersey.
>>
>> I would take an example to illustrate the scenario. There is a obejct
>> 'A' which is a resource and there is 'B' which is also a resource  Now
>> 'A' has one or more 'B'. Now when resource 'A' is accessed it will
>> 'have' 'B' as well, in terms of REST we would want them to referred to
>> using their respective URIs. Now my question is if I am using
>> JAXB/JSON for exporting my resources how can I achieve this?
>>
> You can build URIs that refer to specific instances of resources using the
> methods of UriInfo and UriBuilder. E.g. when building the JAXB bean for A
> you can create links to the associated Bs and add them as values of
> properties of A.
>
> Not sure if I answered your question or not ?
>

Aah, that actually answers the question partially :), thats the way I
was guessing and wanted to avoid :).

Thanks,

Imran

> Marc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>



-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran_at_smartitengineering.com
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557