I was wondering if there is a way to get the URL of the returned resource after a AJAX call in JavaScript?
I want to use this with a form, which is in \"mysite.com/u
Solved this by setting the response header "Location" in a Java Filter.
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
String path = httpRequest.getRequestURI();
httpResponse.setHeader("Location", path);
In JavaScript I could then use
XMLHttpRequest.getResponseHeader("Location")
Hopefully this won't cause any unforeseen problems. :P
If anyone else have an easier solution though I'd like to see it.