serlvets support request-response protocol and not
request-response-acknowledgment protocol.
Once you close the output stream to servlet you wait for response and that's
it, the transaction happened. To acknowledge you have to do another request
(to which you don't need a response).
You need two URLConnections for this.
dave.
Gustav Trede wrote:
> hello,
>
> Can enyone help me on this ?? please.
>
> Senario is:
> i send ordnernumber to servlet.
> servlet sends me the orders.
> I tell the servlet that i succesfully recieved and saved orders on hd.
> here i get exception java.net.ProtocolException: Cannot write
> output after reading input
>
> I want to do all this in the same session.
> communication is done with Objectin/outputstreams like:
> ObjectInputStream in = new ObjectInputStream(new
> GZIPInputStream((urlConn.getInputStream())));
>
> code in client side is:
>
> out.writeObject(ordernumbers); //send ordernumbers to servlet
> out.flush();
> out.close();
>
> ObjectInputStream in = new ObjectInputStream(new
> GZIPInputStream((urlConn.getInputStream())));
> Vector orders = (Vector) in.readObject(); // i get the new orders
> in.close();
>
> I save orders to local hd .
>
> out = new ObjectOutputStream(new GZIPOutputStream
> (urlConn.getOutputStream()));
> out.writeBoolean(true); // i tell the servlet its ok to erase the
> orders on serverside.
> Here i get my exception... how should i do ??
>
> regards
> Gustav Trede
> Swedish Chemistry
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
David Mossakowski [EMAIL PROTECTED]
Programmer 212.310.7275
Instinet Corporation
"I don't sit idly by, I'm planning a big surprise"
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html