Hello there,
I want my
applet to communicate with a
servlet. and hence I use URLConnection and the corresponding IOStreams for that. But a IOException is getting raised.
THe Code is as follows
URL url = new URL("http://10.10.1.78:8080/servlet/SysServer");
String qry = URLEncoder.encode("qry") + "=" + URLEncoder.encode(qryString);
URLConnection uc = url.openConnection();
uc.setDoOutput(true);
uc.setDoInput(true);
uc.setUseCaches(false);
uc.setRequestProperty("Content-type","application/x-www-form-urlencoded");
DataOutputStream dos = new DataOutputStream(uc.getOutputStream());
dos.writeBytes(qry);
dos.flush();<----Here
dos.close();
ObjectInputStream oin = new ObjectInputStream(uc.getInputStream());<---Here
AN IOException is getting raised. at the lines pointed cby "<----Here". The puzzling thing is that the Exception is getting raised at out.flush() and not at the creation of the ouputstream. and I comment the Flush() line ,it is thrown at
uc.getInputStream().
What is the Possible cause
Please act fast
Zafer