I am trying to send the object to the Straight Action class by using the Object output stream, but one exception I created a new instance of URLConnection to give a specific URL and tried to write an object in the URL to send the Stratus action class from the applet Public Save Design () { But it does not work. Please give me some tips if someone knows how to handle this exception. This is to do with the lifecycle of an HTTP request (which is the HttpURLConnection summary) - a Once the request has been sent, you can not modify it any more - if you have more data to send, then just create another one below what is happening when you I do not know what's in GetServletConnection (), but do not forget to read and read from the response, unless you finish writing the request. Java.net.ProtocolException : After reading the input the output can not be written.
I click the applet button button Calling this method to save
try {HttpURL Connection URL Connection = getServletConnection (Call Savelt Connection., Zero); // Pragma = no-cache; Faucet (urlConnection! = Null & amp; URL Connection. Getheadfield (.). ("Prague")! = Faucet) Return false; OutputStream Outstream = urlConnection.getOutputStream (); // Exception can be here ObjectOutputStream Object Outstream = New ObjectOutputStream (Outstream); Objectoutstream.writeObject ("abc"); Objectoutstream.flush (); Objectoutstream.close (); System.out.println ("write vctObjectDetails"); } Hold (malformedURLException exception) {exception Print straps (); } Catch (connect exception exception) {Exceptions Print straps (); } Hold (IOE exception exception) {exception Print straps (); } Hold (exception e) {e.printStackTrace (); }}
getHeaderFields () (Response Header field), then the 'HTTPR Connection' sends the request and provides feedback.
No comments:
Post a Comment