Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Applet calling Servlet - Servlet does not load Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Applet calling Servlet - Servlet does not load" Watch "Applet calling Servlet - Servlet does not load" New topic

Applet calling Servlet - Servlet does not load

Dave Donohoe
Ranch Hand

Joined: May 16, 2000
Posts: 73
I have an Applet that calls a Servlet like so -
String tmp_szServletLocation = "http://localhost:8080/App/TheServlet";

URL tmp_urlServlet = new URL(tmp_szServletLocation);
URLConnection tmp_urlCon = tmp_urlServlet.openConnection();
tmp_urlCon.setUseCaches (false);
ObjectInputStream inputFromServlet = new ObjectInputStream(tmp_urlCon.getInputStream());

I know it goes into the Servlet, as I have Debug Statments within the service method.
BUT, the onload() method in the Servlet never gets triggered.....
ANY ideas please?
[ January 23, 2002: Message edited by: Dave Donohoe ]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
With that URL, the doGet method in the servlet should be called. What is this onload() method and why do you expect it to be called?
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
actually its the doPost one no?
I agree. Here's the link:
subject: Applet calling Servlet - Servlet does not load
Similar Threads
Passing objects between a servlet and an applet
servlet/applet communication problem
Send object from applet to servlet
To pass object from Applet to Servlet and vice versa
Servlet could not send Objects to an Applet