Hi Kevin,

Kevin Duffey escribió:
>
> Hi,
>
> I am curious, using JSP and all..is it better to FORWARD to another page, or
> use the response.sendRedirect(). I notice a strange side effect in using the
> forward in that the URL of the browser no longer reflects the page returned
> when using forward. Doesn't seem to be a big deal to me, and I now its
> faster to return a page, then round-robin to the browser and back again. Is
> there any way to maybe update the URL of the browser to show the new page?
> Or is this the norm when forwarding? I was curious how Model 2 JSP
> developers handle this situation, as they probably forward to a page rather
> than redirect.

We use that because that's what we want ;). I mean, that the browser
doesn't reflect the forwarded URL is not a strange side effect, it's
exactly what we want because the user doesn't have to care about the
exact jsp page that we use to construct the UI. The user should never
call the JSP's direcly so why tempt them by showing them the path. And
reason why is not updated and it's faster than redirect is because
redirect tells THE BROWSER to call the new page, so the browser knows
what the new URL is and has to call it itself. With forward, it's the
CONTAINER that performs the "new call" so the browser thinks that the
result comes from the URL he called, not from a new one.

> Am I correct in that forwarding is a performance enhancement because it
> saves the client from hitting the server twice? Also, could this be the
> reason Netscape sends TWO forms (submits) often, rather than one..or is that
> a Netscape bug others have seen? Odd that When people submit a form with
> MSIE, its fine, but Netscape seems to submit the form twice.

You're rigth about the performance enhancement but I see no reason why
this would make netscape send the same form twice. It's never happened
to me and I always use forward and netscape so... could this be a
strange side effect of some JavaScript that you have in this pages, and
that is just "works" with Netscape and not with MSIE?

I hope this helps,
Dan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to