Forums Register Login

Servlet to Applet

+Pie Number of slices to send: Send
I want to pass object from servlet to applet.For that i have written the below code but im getting error while creating object itself.So please help me.

This is the method i had written in my applet but while running
im getting error "java.lang.IIlegalStateException:cann't mix text and binary input " at line one.

public void sendMatterData(HttpServletResponse response, Vector matterVector){
ObjectOutputStream matterData;
try
{
1. matterData = new ObjectOutputStream(response.getOutputStream());
2. matterData.writeObject(matterVector);
3. matterData.flush();
4. matterData.close();
}
catch (IOException e)
{
System.out.println("Eroor :"+e);
}
}
please help me
+Pie Number of slices to send: Send
you need to set the content type of your response to binary, as opposed to text/html.
eg.
response.setContentType("application/octet-stream");
rubbery bacon. crispy tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 702 times.
Similar Threads
Applet to servlet communication Netscape
Applet and Servlet not talking to each other
Applet to servlet communication-- Urgent
applet-servlet comm using obj serialization --- william,thomas, maha please help
servlet cannot read incoming data
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:03:16.