其实不长,主要就是几句,不知道哪里出错了?// connect to the servlet
URL excelServlet = new URL(webPath+ "/qbean/servlet/smic.QBeanExcelServlet");
URLConnection servletConnection = excelServlet.openConnection();
// inform the connection that we will send output and accept input
servletConnection.setDoInput(true);
servletConnection.setDoOutput(true);
// Don't use a cached version of URL connection.
servletConnection.setUseCaches(false);
servletConnection.setDefaultUseCaches(false);
// Specify the content type that we will send binary data
servletConnection.setRequestProperty("Content-Type", "application/octet-stream");
// send the student object to the servlet using serialization
outputToServlet = new ObjectOutputStream(servletConnection.getOutputStream());
// Put dataModule to the servlet.
outputToServlet = new ObjectOutputStream(servletConnection.getOutputStream());
outputToServlet.writeObject(appletData);outputToServlet.flush();
outputToServlet.close();
servletConnection.connect();