-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Albrecht,

albrecht andrzejewski wrote:
> The client request first hit my Servlet, then should be dispatched to a
> physically distant machine to be analyzed, then my Servlet should read
> the response of this second server, and finally send response to client.

Like a proxy? Do you need to process the request from within the servlet
at all, or are you really just proxying? If you're just proxying, might
I recommend something like squid (http://www.squid-cache.org/)? I'm sure
you can disable caching and make it always forward requests.

> My first idea was to use something like Apache httpclient, or anyway,
> writing a java HTTP client allowing my servlet to send GET request
> before returning httpResponse.

Httpclient will work. I don't recommend writing your own client unless
you have some decent Java chops... lots of ways to leak resources and
stuff when you're working with URLConnections.

> I wonder if there were other better solutions, which could be more
> "RequestDispatcher-like".

I don't think there's really anything out there like
RemoteRequestDispatcher.forward(request, response), but you could write
one that wraps, say, httpclient.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmMVRMACgkQ9CaO5/Lv0PAt6QCcCuodj12SNtIqrRFczag+903S
hHIAnRXCbKkI09XP6jymopQE5XWCZBDA
=CJc9
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to