hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "D Alvarado" <laredotorn...@wildmail.com>
Subject Change domains after faking a POST?
Date Wed, 21 Jan 2004 15:13:50 GMT
Hello,
   I am writing a servlet on www.mydomain.com. 
The servlet POSTs data to www.otherdomain.com
using HttpClient and associated classes.  Then,
www.otherdomain.com sends back a response, 

<html>
<head></head>
<body onload="document.forms[0].submit();">
<form name=f
action="/otherdomainfolder/dostuff.cgi"
method="post">
   <input name="input1" value="val1" type="hidden">
   <input name="input2" value="val2" type="hidden">
</form>
</body>
</html>

Unfortunately, this generates a 404 error on the
client machine because its still referencing
www.mydomain.com and it should be considering
this response in the context of
www.otherdomain.com.  How do I make that so?

Much thanks for your time, - Dave

ps - I handle the response from
www.otherdomain.com like this:

        // Read the response body.
        InputStream in =
postMethod.getResponseBodyAsStream();
        BufferedReader br = new
BufferedReader(new InputStreamReader(in));
        String nextLine = "";
        String responseBody = "";
        while ((nextLine = br.readLine()) != null) {
                responseBody += nextLine.trim();
        }
        out.println(responseBody);



Care2 make the world greener!
Eighty-six nations have signed the international Framework Convention on Tobacco Control.
Help get the U.S. on the list! http://www.care2.com/go/z/10840/1060

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message