Christian Sell wrote:
>
> As far as I remember, there is another difference between sendRedirect() and
> RequestDispatcher.forward(). I once tested both alternatives, and I found
> that with forward(), the client never gets to know that he hase been sent to
> another page, i.e. the URL does not show, the reload button reloads the page
> from where the forward was done, etc. I think I remember there were even
> problems with links on the page..
That's what I've said. It speeds up your application response because of
missing additional requests just to get the required resource/page. It
also happens in case of include, but workflow is opposite so your page
collect all information before sending it back to a client.
I'd not say it's a problem. If your client refreshes a page, depending
on browser settings, there might be another request doing exactly the
same thing as before, so the results might be the same as well. On the
other hand, sendRedirect() sends a page with a header containing
information that a browser must request another page being set in
header. So, that's pretty the same as in above case when using
RequestDispatcher as a browser refreshes current page - no matter if it
came from sendRedirect() or RequestDispatcher. I didn't see any problems
so far.
Jacek Laskowski