On Thu, 3 Jan 2002, Gianluca D'Introno wrote:
> Date: Thu, 3 Jan 2002 17:55:12 +0100
> From: Gianluca D'Introno <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: tomcat list <[EMAIL PROTECTED]>
> Subject: Servlet Filter
>
> Can I use Filter to send resource stored in another webserver to client
> browser?
> How can I do it?
> Thanks!!!
>
You could do this kind of thing in a Filter, but that's not really what
they are designed for.
However, you can do it with a standard Servlet as well -- in the doGet()
and/or doPost() methods of your servlet, you would use an
HttpURLConnection to go get the data from the remote webserver, and then
copy it to the output of this request. There's some example code for
using HttpURLConnection in the Java Language Tutorial (see the Networking
Trail) at <http://java.sun.com/docs/books/tutorial/>.
Craig McClanahan
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>