tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
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 <gianlucadintrono@hotmail.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: tomcat list <tomcat-user@jakarta.apache.org>
> 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:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message