title: Intertwining resources in Jersey in a mutual way
body: <p>I'm trying to get my head around this RESTful scenario in Jersey: I have two resources, User and Item, and i want to retrieve all the items connected to a certain user and all the users connected to a certain item. In short, there exists a many-to-many relationship between User and Item.</p>
  
  <p>I came across this RESTful design:</p>
  
  <ul>
  <li>All the items connected to a certain user: <code>GET .../users/{user_id}/items</code></li>
  <li>All the users connected to a certain item: <code>GET .../items/{item_id}/users</code></li>
  </ul>
  
  <p>How can I implement this in Jersey? I found <a href="https://stackoverflow.com/questions/25755130/nested-resources-in-jersey-jax-rs-how-to-implement-restangular-example">this</a> solution, but it's related to sub-resources nested in the root resource, whereas in my case User and Item are both root resources accessible via their own URIs.</p>