Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8736395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:17:41+00:00 2026-06-13T10:17:41+00:00

I am wanting to post data to an html form on a website I

  • 0

I am wanting to post data to an html form on a website I have. So far I was testing it with:

HttpClient httpClient = new HttpClient();
                PostMethod postMethod = new PostMethod("website URL");
                postMethod.addParameter("company_label", customerCompany);
                postMethod.addParameter("customer_name_label", customerName);
                try {
                    httpClient.executeMethod(postMethod);
                } catch (HttpException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }

                if (postMethod.getStatusCode() == HttpStatus.SC_OK) {
                    String resp = postMethod.getResponseBodyAsString();
                } else {
                     //...postMethod.getStatusLine();
                }

But it throws this error

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:66)
    at main.main(main.java:113)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

Am I on the right path to do what I want or should I be doing this differently?

The form I am trying to use looks like

<form name ='XXXXXXX' method='post' onSubmit='return validate_b3cdee6457e94aae9dee29379f9b9470()'>
  <input type='hidden' name='done' value='XXXX' border='0'>
  <input type='hidden' name='version' value='2' border='0'>
  <table border='0' cellspacing='1' cellpadding='2' width='50%' >
    <tr>
      <td><table border='0' cellspacing='1' cellpadding='2' width='50%' >
          <tr>
            <td class='DarkText' style='color:red'><div id='XXXXXXXX' style='display:none;'></div></td>
          </tr>
        </table>
        <div id='div_webForm_b3cdee6457e94aae9dee29379f9b9470'>
          <table border='0' cellspacing='1' cellpadding='2' width='100%' >
            <tr valign='top' id='text_field_row_company' >
              <td  style=''  width='20%' id="company_label"  nowrap class='FormLabel' >Company</td>
              <td class='FormField'      ><input id="company" type='text' name='company' size='30' maxlength='255' class='inputForm'  value=""       ></td>
            </tr>
            <tr valign='top' id='text_field_row_customer_name' >
              <td  style=''  width='20%' id="customer_name_label"  nowrap class='FormLabel' >Customer Name</td>
              <td class='FormField'      ><input id="customer_name" type='text' name='customer_name' size='30' maxlength='255' class='inputForm'  value=""       ></td>
            </tr>
            <tr valign='top' id='text_field_row_phone' >
              <td  style=''  width='20%' id="phone_label"  nowrap class='FormLabel' >Phone</td>
              <td class='FormField'      ><input id="phone" type='text' name='phone' size='30' maxlength='255' class='inputForm'  value=""       ></td>
            </tr>
            <tr valign='top' id='text_field_row_email' >
              <td  style=''  width='20%' id="email_label"  nowrap class='FormLabel' >Email</td>
              <td class='FormField'      ><input id="email" type='text' name='email' size='30' maxlength='255' class='inputForm'  value=""       ></td>
            </tr>
            <tr valign='top' id='text_field_row_needs' >
              <td  style=''  width='20%' id="needs_label"  nowrap class='FormLabel' >Needs</td>
              <td class='FormField'      ><input id="needs" type='text' name='needs' size='30' maxlength='255' class='inputForm'  value=""       ></td>
            </tr>
            <tr valign='top' id='field_row_id_other_needs'  >
              <td    style='' width='20%' height=28px nowrap class='FormLabel'  id='field_cell_label_id_other_needs' >Other Needs</td>
              <td     class='FormField'  id='field_cell_value_id_other_needs'  ><textarea id='other_needs' name='other_needs' rows='5' cols='30'  class='inputForm'   ></textarea></td>
            </tr>
            <tr>
              <td></td>
              <td><input type='submit' name='submitButtonName' value='Submit' border='0' ></td>
            </tr>
          </table>
        </div></td>
    </tr>
  </table>
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:17:42+00:00Added an answer on June 13, 2026 at 10:17 am

    Your code works ok with me with 3 jars and Open JDK 1.6

    commons-httpclient-3.1.jar
    commons-logging/1.0.4/commons-logging-1.0.4.jar
    commons-codec/1.2/commons-codec-1.2.jar
    

    I’ve tested on:

    PostMethod method = new PostMethod("http://search.yahoo.com/search");
    

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form. This form will submit data to 2 different pages. After
I'm using my own HTTP wrapper using sockets. So far everything works except multipart/form-data
I have a for loop displaying XML data from the last.fm API. Im wanting
Hi just looking for some direction, I have a HTML form which has several
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after
I have a form that e-mails the form data to a e-mail address. I
So this all stemmed from not wanting to check each POST in a huge
Wanting to integrate aspects of SharePoint into an existing website - rather than integrating
I have a problem with persisting data via play-framework. Maybe it's not possible to
I've started the following skeleton for an ajax/post/update function I'm wanting to write in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.