Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending an Array to a Servlet

Status
Not open for further replies.

dvknn

IS-IT--Management
Mar 11, 2003
94
US
Hi,
I have a standalone client whicch invokes a Servlet.
I want to send an INTEGER ARRAY as a parameter to the Servlet. Can I do that?

If so can anybody show me how??
 
Use a HttpURLConnection object to establish a connection with the servlet. Then retrieve the OutputStream from the HTTP conn, then loop the array, writing the contents to the stream.
 
I have 4 params that I am sending to the Servlet.

One of my parameters that I am sending to the Servlet is an INTEGER ARRAY.

I formed 'key-value' pair Strings..But, my question is..

Can I send an integer array as a parameter or I should send ONLY String arrays??

If I can send an array I will be sending them as any normal parameter??
 
Hi,

You cannot send an INTEGER array to a servlet. Servelt Container reads every parameter as a String Object. Yes, you have to send the array as a normal parmenters.

Cheers,
Venu
 
Venu,

Is it written anywhere?? Could you point me to the source..

I know that while getting parameters, out of the request Object, they all return Strings..I can do a getqueryString and get the query String and then parse the string to get the parameters that I sent in..

I thought, I can send in any Object as part of Query String..

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top