Hi there,

I do have a small problem sending serialized objects from applets
to servlets. Most assumably, the problem has to do with setting
the correct MIME type....)

Consult code given below:

URLConnection connection = null;
try {
URL url = new URL( this.getCodeBase()
                + "servlet/TaxonomyServlet?taxonomy=" + t.getName() );
            connection = url.openConnection();
System.out.println( "TaxonomyTreeApplet#setTaxonomyInServlet Connection made" );
            connection.setDoInput( true );
            connection.setDoOutput( true );
            connection.setUseCaches( false );
            connection.setDefaultUseCaches( false );
            connection.setRequestProperty( "Content-type", "application/octet-stream" 
);
        } catch (Exception e ) {
            e.printStackTrace();
        }

        try {
            ObjectOutputStream oos =
                new ObjectOutputStream( connection.getOutputStream() );
            oos.writeObject( t );
            oos.flush();
            oos.close();
System.out.println( "TaxonomyTreeApplet#setTaxonomyInServlet taxonomy stored:" + 
t.getName());
        } catch ( Exception e ) {
            e.printStackTrace();
        }

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to