title: How to forward a request using JAX-RS?
body: <p>I want to forward a REST request to another server.  </p>
  
  <p>I use JAX-RS with Jersey and Tomcat. I tried it with setting the <code>See Other</code> response and adding a <code>Location</code> header, but it's not real forward. </p>
  
  <p>If I use: </p>
  
  <pre><code>request.getRequestDispatcher(url).forward(request, response); 
  </code></pre>
  
  <p>I get: </p>
  
  <ul>
  <li><code>java.lang.StackOverflowError</code>: If the url is a relative path</li>
  <li><code>java.lang.IllegalArgumentException</code>: Path <a href="http://website.com" rel="noreferrer">http://website.com</a> does not start with a <code>/</code> character (I think the forward is only legal in the same servlet context).</li>
  </ul>
  
  <p>How can I forward a request?</p>