Hello.
I tried to use the class com.javaranch.common.Http for a similar problem (Applet to Servlet communication). I can read from the servlet. However when I try to write to it, I also get "FileNotFoundException" excpetion. My Applet code to send an object to the servlet is as follow:
URL myurl = new URL(getCodeBase(), "/servlet/SimpleServlet");
URLConnection con = myurl.openConnection();
con.setUseCaches( false );
con.setDoOutput(true);
con.setRequestProperty("Content-type","application/octet-stream");
Object obj = new String(fname);
ObjectOutputStream out = new ObjectOutputStream( new GZIPOutputStream( con.getOutputStream() ) );
if ( obj != null )
{
out.writeObject( obj );
}
out.close();
Any help or idea is appreciated.
Regards,
Arsalan Madjd