java.io.EOFException while writing and reading froma servlet

被刻印的时光 ゝ 提交于 2019-11-28 11:40:55
Arun VC

Close the ObjectOutputStream at the end.

ObjectOutputStream out = new ObjectOutputStream(con.getOutputStream());
out.writeObject(user);//user is an object of a serializable class
out.flush();
out.close(); //Don,t close your out here

ObjectInputStream in = new ObjectInputStream(con.getInputStream());
status = (String)in.readObject();
in.close();

out.close(); //Close your out after reading the input
user6582737

first request.getParameter()
then request.getInputStream()

this case must course exception on tomcat ,but not course exception on weblogic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!