I am working on a web application that uses jersey. I am trying to implement things obtained after publication using URIBuilder and seeOther. The goal is to redirect to the same URI in which the browser is already on, but to force a GET. It works something like this:
- The request comes through PUT
- PUT request processed
- See the Returned Answer.
What should happen is that the browser takes 303 See Other and performs a GET in the URI that it receives. Unfortunately, it happens that it does PUT on a URI instead (as far as I can tell), and PUT sends it back to Step 1. above, causing a redirect loop.
Any ideas what is going wrong here?
private Response giveSeeOther(){
final UriBuilder uriBuilder = m_uriInfo.getBaseUriBuilder();
final Map<String, Object> parameterMap = new HashMap<String, Object>();
parameterMap.put("uid", getUid());
final URI redirectUri = uriBuilder.path(SomeObject.class).
path(SomeObject.class, "get").
buildFromMap(parameterMap);
return Response.seeOther(redirectUri).build();}
. , , .