One thing that you need to do is make an URL object from the string of the
URL, so you need to add a line: URL someURL = new
URL("http://newurl/servletname");
because I think the method getRequestDispatcher(Url url) takes a url object.
hth,
-Elaine
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Mike
Shoemaker
Sent: Sunday, July 22, 2001 1:16 PM
To: [EMAIL PROTECTED]
Subject: Redirect from one servlet to another?
Hello gang.
Anyone have any idea how to do this? I will paste a code snippet below that
Im working on and it doesn't seem to work.
I have a feeling that you can redirect to a different domain, is this true?
Any input would be appreciated.
// Do Redirect to page
try {
String url = "http://newurl/servletname;
RequestDispatcher rd =
this.getServletConfig().getServletContext().getRequestDispatcher(url);
rd.forward(req, res);
} catch(Exception e) {
e.printStackTrace();
}
TIA
Mike
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
___________________________________________________________________________
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