Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet won't connect to servlet

 
Mike London
Ranch Hand
Posts: 1227
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have code that is trying to get an applet do a writeObject to a servlet after I create a URL, but nothing is happening when I click the button on the applet to connect to the servlet.
I've posted my code on the Servlet section.
I would welcome any ideas and replies.
Thanks.
-- Mike
 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can think of two things to check.
(1) In my own applet-servlet communcation I found that in some cases it was necessary not only to open an output stream but also an input stream regardless of the fact that I wasing going to get something back from the servlet. I still needed to open the input stream in order for the actual communication to start. Until then, everything I wrote to the output stream was just being buffered up in mememory and wasn't going anywhere. This is probably what's going on with your code.
(1) Is the servlet on the same server that the applet is retrieved from? It is against security policy for an applet to open any kind of socket to a sever other than the one it came from. I think it can be done however if the applet is signed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic