So you will - intercept the incoming request. - depending on the request, ask another server for data. - Mangle the other server data - feed back to client.
This sounds like reinventing the wheel since there is XML-RPC or SOAP. (See apache axis project for more info)
Still ... jakarta HttpClient should be ok.
-Tim
Pike wrote:
Hi
thanks for your response
I would like to write a servlet that intercepts http requests, and optionally rebuilds and redirects them to other (remote) servers.
Httpclient should work fine.
ehm .. which one ? the apache/commons ? I'm afraid that's a little too restricted...
Ideally, if you wish to have a tomcat servlet act a proxy server, be sure you read the HTTP specs with respect to proxy servers. There are many gotchas.
I don't think I need to. Tomcat should behave as a plain webserver. Behind the scenes it fetches his data from elsewhere on the web. The client doesn't need to know that.
so, maybe I shouldn't call it a proxy.
Before writing too much code and IF you are able to use apache, it would be infinitely easier to use mod_proxy.
mod_proxy doesnt actually _do_ anything does it ? it just proxies. I want to intercept the request and rebuild it (with some app logic) before sending it on...
I'm surprised it seems so hard to do. I imagined there would be something like HttpServletRequest.dispatch(url) for remote requests.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]