Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

request.sendRedirect or javascript: document.location.replace()

843840May 17 2002 — edited May 18 2002
We are developing JSP projects on WAS3.5. We are not using J2EE or XML. We are currently using all JSP's in our projects without the use of servlets. When we need to redirect to a different page, we use:

<script language="JavaScript1.2">
<!-- Begin
top.document.location.replace('LoginAgain.jsp');
// End -->
</script>

We have begun looking into using servlets instead of this approach. What is the difference in using the above technique and using sendRedirect? In a previous post from 5/17/2002, markkid explains that sendRedirect uses the following approach: server->browser->server->browser. Is this more efficient than the document.location.replace described above?

Would you recommend continuing in our current approach or switching to use servlets? Please explain.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2002
Added on May 17 2002
2 comments
161 views