tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: Servlet Filter
Date Thu, 03 Jan 2002 18:18:45 GMT

On Thu, 3 Jan 2002, Gianluca D'Introno wrote:

> Date: Thu, 3 Jan 2002 17:55:12 +0100
> From: Gianluca D'Introno <>
> Reply-To: Tomcat Users List <>
> To: tomcat list <>
> 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 <>.

Craig McClanahan

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message