I want to forward a REST request to another server.
I use JAX-RS with Jersey and Tomcat. I tried it with setting the See Other
response and adding a Location
header, but it's not real forward.
If I use:
request.getRequestDispatcher(url).forward(request, response);
I get:
java.lang.StackOverflowError
: If the url is a relative pathjava.lang.IllegalArgumentException
: Path http://website.com does not start with a/
character (I think the forward is only legal in the same servlet context).
How can I forward a request?