Hi,

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("
http://localhost:8080/TMC/home.do";);

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

        method.setRequestBody(nv);

        method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                new DefaultHttpMethodRetryHandler(3, false));

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

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

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

Reply via email to