I am using Apache HTTP Client and I have to send a Publish request to my servlet. Once the request is distributed my servlet doesn't get any parameters (within the HttpServletRequest).

This is actually the client rule:

// Engage the HTTP client
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpResponse response;
try {
    HttpPost httpPost = new HttpPost("http://localhost:8080/test-json-web/JSONReceiverServlet");

    // Setup the request parameters
    HttpParams params = new BasicHttpParams();
    params.setParameter("taskdef", task1JsonString);
    httpPost.setParams(params);

    // Make the request
    response = httpclient.execute(httpPost);

    HttpEntity responseEntity = response.getEntity();

    System.out.println("----------------------------------------");
    System.out.println(response.getStatusLine());
    if(responseEntity != null) {
        System.out.println("Response content length: " + responseEntity.getContentLength());
    }

    String jsonResultString = EntityUtils.toString(responseEntity);
    EntityUtils.consume(responseEntity);
    System.out.println("----------------------------------------");
    System.out.println("result:");
    System.out.println();
} catch (ClientProtocolException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
} finally {
    httpclient.getConnectionManager().shutdown();
}

How you can properly set Publish request parameters to ensure that servlet really receives them?

do this:

        List <NameValuePair> nvps = new ArrayList <NameValuePair>();
        nvps.add(new BasicNameValuePair("IDToken1", "username"));
        nvps.add(new BasicNameValuePair("IDToken2", "password"));

        httPost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));

The HttpParams class isn't what you would like. Rather make use of the setParameter(..., ...) of the PostMethod object. Something similar to:

HttpClient client = new HttpClient();         // set credentials as needed
PostMethod post = new PostMethod("url");      // point to your URL
post.setParameter(name, value);               // set request params here
int responseCode = client.execute(post);      // check for 404 etc.
byte[] responseBody = post.getResponseBody();

Best of luck!