This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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: 13037
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
It's not a secret anymore!