hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Srinivas Chamarthi" <srinivas.chamar...@gmail.com>
Subject getting null form in struts when form data is posted using http client
Date Mon, 21 Apr 2008 11:50:00 GMT

I am using the following code to access struts based web application. But
when the request passes to the application in execute method, the form is
coming as null. Could you please let me know why am I getting null form ?
Appreciate any help in this regard.

        HttpClient client = new HttpClient();

        PostMethod method = new PostMethod("

        NameValuePair[] nv = new NameValuePair[3];
        nv[0] = new NameValuePair("siteUser","admin");
        nv[1] = new NameValuePair("sitePassword","test");
        nv[2] = new NameValuePair("timeZone","PST");


                new DefaultHttpMethodRetryHandler(3, false));

        try {
               int statusCode = client.executeMethod(method);

               if (statusCode != HttpStatus.SC_OK) {
                    System.err.println("Method failed: " +

            // Read the response body.
              byte[] responseBody = method.getResponseBody();

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message