A call to sendRedirect is simply a shortcut to setting the appropriate headers, and so what you are doing is sending conflicting headers. Apparently, the redirect headers take effect before any refresh headers (which makes sense and may be spelled out in the HTTP spec, but I'm not going to search for it.)
Randall Nickerson wrote:but this doesn't answer my question.
Nope -- you're saying go North and South as the same time.
In fact what I seem to be doing from my perspective is saying, "Hey, response object, here is some header information. Now take that and load this jsp page."
I'd recommend backing up and approaching the problem in a more conventional fashion than trying to find tricks.
Is there a way to set http headers in the response object and have them remain applicable when a jsp page is loaded into the browser?
Randall Nickerson wrote:Well, I was hoping to get a more direct answer to my original question. Indirectly I guess I can infer that you are saying there is not a way to have a servlet send a jsp to a browser and have that jsp automatically reload the servlet using headers.