You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Sören Hoffmann <so...@kandelbach4.info> on 2007/07/29 15:16:39 UTC

using with httpclient ?

Hello,

I have a problem to submit data to a server using " <input type="image"> ".

Here the html source:

<form name="ExportBillDataForm" method="post"
action="/bop/ebp/app/billpresentment/exportprocessbans">
                <!-- A D D   A L L   B U T T O N -->
                <input type="image" name="addAllButton"
src="/bop/ebp/images/buttons/but_add_all.gif" border="0" alt="Alle
zuweisen"><br>
                <img src="/bop/ebp/images/pixel.gif" height="5"
border="0"><br>

                <!-- R E M O V E   A L L   B U T T O N -->
                <input type="image" name="removeAllButton"
src="/bop/ebp/images/buttons/but_substract_all.gif" border="0" alt="Alle
entfernen"><br></form>

Here my httpclient code:

 client.executeMethod(authget);
            PostMethod authpost1 = new
PostMethod("/bop/ebp/app/billpresentment/exportprocessbans");
            NameValuePair action   = new NameValuePair("action",
"/bop/ebp/app/billpresentment/exportprocessbans");
            NameValuePair url1      = new NameValuePair("url", 
"/bop/ebp/app/billpresentment/exportprocessbans");
            NameValuePair bla = new NameValuePair("addAllButton",
"addAllButton");
            authpost.setRequestBody(new NameValuePair[] { action, url,bla
});
  client.executeMethod(authpost1); 

but I didn't get the valid result, because the server don't revceive the
"addAllButton" attribute..


How can I submit  data with <input type="image"> using httpclient?

Thanks for your help....
           


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: using with httpclient ?

Posted by Roland Weber <os...@dubioso.net>.
Hello Sören,

> <form name="ExportBillDataForm" method="post"
> action="/bop/ebp/app/billpresentment/exportprocessbans">
[...]
>             NameValuePair action   = new NameValuePair("action",
> "/bop/ebp/app/billpresentment/exportprocessbans");

'action' is not a parameter name, omit it.

> How can I submit  data with <input type="image"> using httpclient?

It's explained in the primer, section "Analyze the Form":
http://wiki.apache.org/jakarta-httpclient/ForAbsoluteBeginners#head-93d017d102ea8a83b2ad6e07c5184ec2f922f09a

cheers,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org