Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to transfer multiple value from applet to servlet

843842May 7 2009 — edited May 8 2009
Hi,
I want to know how can we transfer multiple values from applet to servlet.Am successful in transferring single value but don't know about multiple.*Can i transfer array of string this way from applet?:*

String ar[]={fname,uname};
URLConnection con = getServletConnection1();
OutputStream outstream = con.getOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(outstream);
oos.writeObject(ar);
oos.flush();
oos.close();

BUT HOW ABOUT in server side:

I have this over there:in servlet(This will definitely not work.This servlet code i made for accepting single string value)
What are the changes i should do in servlet code for accepting my string array from applet ?

InputStream in = request.getInputStream();
ObjectInputStream inputFromApplet = new ObjectInputStream(in);
String answer = (String) inputFromApplet.readObject();
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2009
Added on May 7 2009
5 comments
91 views