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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Applet calling Servlet - Servlet does not load" Watch "Applet calling Servlet - Servlet does not load" New topic
Author

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);
tmp_urlCon.setDefaultUseCaches(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
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
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?
Bill
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
actually its the doPost one no?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet calling Servlet - Servlet does not load