dcsimg
why does bi-directional applet - servlet communication not work?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ben_Brand
Posted On:   Wednesday, June 25, 2003 03:23 AM

I am stumped, hope someone can help out. I have an applet talking to a servlet using some options sent through the URL (= doGet). The servlet queries a database, creates a vector with the results and serializes it back to the applet. No problem, works like a charm. Now I want to expand on this: - call the servlet using some parameters to determine what it should do (= doGet) - write a serialized vector of information from the applet to the servlet - the servlet queries a database based on what is in the vector - the servlet creates a HashMap with the results of the queries and sends the serialized HashMap back to the applet What happens is that I    More>>

I am stumped, hope someone can help out.

I have an applet talking to a servlet using some options sent through the URL (= doGet). The servlet queries a database, creates a vector with the results and serializes it back to the applet. No problem, works like a charm.

Now I want to expand on this:

- call the servlet using some parameters to determine what it should do (= doGet)

- write a serialized vector of information from the applet to the servlet

- the servlet queries a database based on what is in the vector

- the servlet creates a HashMap with the results of the queries and sends the serialized HashMap back to the applet


What happens is that I am getting an EOFException when the servlet attempts to read the Vector. The Vector is not empty. I have tested this with a String bu the same result.

Am I missing something fundamental here, because this really has me stumped? I have not read anything prohibiting me to write a Vector and receive a HashTable but I am getting the impression that writing and then reading on the same servlet connection is screwing things up.

Thanks
Ben

   <<Less

Re: why does bi-directional applet - servlet communication not work?

Posted By:   Zvonko_Pino  
Posted On:   Wednesday, June 25, 2003 04:04 AM


Hi, I think the problem is that you are using a GET method instead a POST method. In brief, you should remember that GET method was made just for retrieving data ("idempotent" FORM processing) so it has limitations in both for sending large data sets and sending non-ASCII characters.
 

good luck!
About | Sitemap | Contact