Hi
I am doing following to seralize and send my response in my servlet,
ObjectOutputStream outputToApplet;
outputToApplet = new ObjectOutputStream(response.getOutputStream());
outputToApplet.writeObject(data);
outputToApplet.flush();
outputToApplet.close();
How do i get this seralized object data using HttpClient, i need to get this
Object passed from the servlet,
My Code is as below
HttpClient client = new HttpClient();
PostMethod postMethod = new PostMethod(url);
NameValuePair[] data = {
new NameValuePair("as400Name", as400Name),
new NameValuePair("envName", envName),
new NameValuePair("fileName", fileName)
};
postMethod.setRequestBody(data);
postMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(3, false));
int statusCode = client.executeMethod(postMethod);
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " +
postMethod.getStatusLine());
}
// Read the response body.
byte[] responseBody = postMethod.getResponseBody();