Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Applet to Servlet

Reply
Thread Tools

Applet to Servlet

 
 
Angelo Marchionni
Guest
Posts: n/a
 
      02-15-2010
I m trying to send data from applet to servlet in this way

ObjectOutputStream outputToServer = new
ObjectOutputStream(servletConnection.getOutputStre am());
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

 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      02-15-2010

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.
 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      02-15-2010
On 15-02-2010 07:37, Angelo Marchionni wrote:
> I m trying to send data from applet to servlet in this way
>
> ObjectOutputStream outputToServer = new
> ObjectOutputStream(servletConnection.getOutputStre am());
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
applet to applet - servlet model Tedy Java 1 08-04-2005 11:08 AM
Offending class: javax/servlet/Servlet.class chamikara Java 1 06-19-2004 05:42 AM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM
Tomcat: POST from one servlet or internal class to another servlet Sean Clarke Java 1 01-07-2004 02:22 PM
how to get my servlet configuration before the servlet is initialised Andy Fish Java 4 12-17-2003 09:47 PM



Advertisments