|
From: Seamus D. <sea...@ca...> - 2003-12-03 15:22:22
|
Hi,
Background
-----------------
I want to change the content of a org.mortbay.http.HttpResponse object in a
proxy and return the modified response to the client. I have written a class
that extends the ProxyHandler class which performs the standard proxy
operation. However once I have the HttpResponse object it is not clear how I
can get at the message content. By content I mean the non header content of
the http response - i.e. the requested page itself. There are plenty of
helper methods for header manipulation but none for content manipulation.
What I want to do
--------------------------
I want to retrieve the message content from the response object
I want to modify this content and then
set the response object to contain the new modified content.
here is the structure of my proxy handler class...
public class MyProxyHandler extends ProxyHandler
{
public void handle(String pathInContext,
String pathParams,
HttpRequest request,
HttpResponse response)
throws HttpException, IOException
{
super.handle( pathInContext, pathParams, request, response );
//modify response object content here
//retrieve the original content from the response object (????)
//transform this content
//put the transformed content into the response object (????)
}
}
perhaps I am going about this the wrong way?
regards,
Seamus Donohue
|