Maybe someone can answer this. How does the sendRedirect method work? Does it depend on browser support (in other words, possibly not all browsers support it)? The browser is actually sent to a new URL, which shows up in the browser's address bar... I was just wondering how this works, if it uses some http header, etc.
- Posted by: Jim Hall
- Posted on: July 01 2002 10:57 EDT
Not that your question has anything to do with Struts, I do explain in somewhat detail how a redirect diffs from a forward in Chapter 2 of my upcoming O'Reilly book on Struts.
You can download chapter 2 from right here on this site:
Take a look at that section in Chapter 2 and see if it helps make things clearer.
Thank you, that was very informative. Do all or most browsers automatically redirect to the new URL? It would be awkward and undesirable if in the middle of navigating your application, a user encountered some "This page has temporarily moved" error screens.
To my knowledge, this behavior is part of the specification and all compliant browsers should know how to handle a 302 and request the new URL. I'm not sure if any browser has the ability to turn off being redirected. I haven't seen an option like that, but it might exist on one of them.
I think redirection is a pretty common occurrence.