-- client

NameValuePair[] data = new NameValuePair[] {
  new NameValuePair("surname", "Lee"),
  new NameValuePair("name", "Wai See")
};


-- servlet

String surname = request.getParameter("surname");
String name = request.getParameter("name");

Hope that helps

Ortwin

Lee Wai See wrote:
Hi,

I have the following situation which I hope someone would be able to help me
with.

On the sender side, I am using HttpClient and have these few lines:

HttpClient httpClient = new HttpClient();

            postMethod.addParameters (data);        // data is of type
NameValuePair[]

            httpClient.executeMethod(postMethod);

On the receiver side, I need to use the javax.servlet.http.HttpServlet with
the HttpServletRequest req. How can I get the parameters of NameValuePair[].
If I do a req.getParameter(), I will only get the first element of the
NameValuePair[].

I want to get all the elements of NameValuePair[]. How can I go about doing
it? It would be greatly appreciated if someone could guide me in this.
Thanks in advance.

Regards, Lee Wai See


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.9/457 - Release Date: 9/26/2006




--
[web]  http://www.odi.ch/
[blog] http://www.odi.ch/weblog/
[pgp]  key 0x81CF3416
       finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to