Applet to Servlet

A

Angelo Marchionni

I m trying to send data from applet to servlet in this way

ObjectOutputStream outputToServer = new
ObjectOutputStream(servletConnection.getOutputStream());
outputToServer.writeObject(user);
outputToServer.flush();
outputToServer.close();

I expect data goes to doPost method of the servlet.
But when I execute the above portion of the code just the doPost
method is not called.
What do I do wrong ?

Thanks
 
M

markspace

You'll need to show us the code before "new ObjectOutputStream(...".
There must be something in the way you are setting up the HTTP
connection that is causing an issue.

Have you tested this servlet yet? Can it receive any POST at all, even
from a browser? It doesn't hurt to verify the other side too, just in
case the problem isn't where you think it is.
 
A

Arne Vajhøj

I m trying to send data from applet to servlet in this way

ObjectOutputStream outputToServer = new
ObjectOutputStream(servletConnection.getOutputStream());
outputToServer.writeObject(user);
outputToServer.flush();
outputToServer.close();

I expect data goes to doPost method of the servlet.
But when I execute the above portion of the code just the doPost
method is not called.
What do I do wrong ?

Do you call:

servletConnection.setRequestMethod("POST");

?

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top