Servlet call html page outside of domain
Hi,
I am looking for an example of a Servlet calling an HTML page. I have see a lot like
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("index.html");
rd.forward(request, response);
These work fine if the HTML page is in your domain, but how can you call one if it isn't. For exmaple, how can I call http://www.cnn.com form a Servlet? You can't do it like this:
RequestDispatcher rd = this.getServletContext().getRequestDispatcher("http://www.cnn.com");
rd.forward(request, response);
[602 byte] By [
mbrown36a] at [2007-10-2 5:30:04]

Hi,
I am also looking for the same.
Actually my requirement is like, I have a servlet and I want to call a static html page which is not the part of servlet's application. (lets application name is 'jeet')
And lets suppose the path for static page is like C:\test\test.html.
It is not working if I code like response.sendRedirect("C:/test/test.html");
Above code gives error' jeet/C:/test/test.html' not found.
Any help is highly recognized.
No Olakara, I am not attempting to download.
Well I narrate the things to you.
All problems are coming b/c of Help files. Actually earlier help files were in application folder and now we have kept those help files outside the application folder.
So at UI side we have a button and onClick event of it we are calling a servlet to get help files on a popup window.
Now the problem comes here, since we kept those help file outside the application folder so servlet are able to find the location but unable to forward it (now we have fine location).
Help files are in html format
Please do reply.
Thanks & Regards,
-- Jeet