Is there a problem with

response.sendRedirect(myUrl);

Also, javascript may be disabled, so I'd use

out.println("<HTML><HEAD>\n");
out.println("<meta http-equiv=\"Refresh\" content=\"0, url= " + myUrl +
"\">\n");
out.println("<body>\n");
out.println("<a href=\"" + myUrl + "\"> Next</a>\n");
out.println("</body>\n</html>");

or something to that effect.
The operative line is the
<meta http-equiv="Refresh" content="0, url=someURL">
 and it's always nice to leave an achor "just in case" but YMMV

/bill


Please respond to "A mailing list for discussion about Sun Microsystem's Java
      Servlet API Technology." <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:    (bcc: Bill Fellows/MO/americancentury)
Subject:  must be a better way


Below is a portion of code that I use to exit a servlet and redirect the web
browser to a different HTML page after writing data to a db.

      out.println("<HTML><HEAD>");
      out.println("<SCRIPT language=\"javascript\">");
      out.println("var home=\"http://xxx.xxx.xxx.xx/next.html\";");
      out.println("setTimeout(\"location.href=home;\", 1);");
      out.println("</SCRIPT><HEAD><BODY>");
      out.println("</BODY></HTML>");


There must be a better way than this to jump to a new HTML page!
Please, any suggestions?
Thanks.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to