views:

26

answers:

1

I'm using GAE with Java servlets. I have a form POST request, and I have to redirect the browser to a new location with GET method. How can I do this?

+2  A: 

I got solution:

http://en.wikipedia.org/wiki/Post/Redirect/Get

This is my code sample:

private void seeOther(HttpServletResponse resp, String pathOfOtherToSee)
{
    resp.setStatus(HttpServletResponse.SC_SEE_OTHER);
    resp.setHeader("Location", pathOfOtherToSee);       
}
Eonil
Yup, that's pretty much the standard way. Would you care to show us the code to do this w/ Java servlet?
Piskvor
Added code sample. I wish this helps.
Eonil