• Post Reply Bookmark Topic Watch Topic
  • New Topic

applet init not calling doGet

 
sean cee
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I had a simple applet which calls a servlet(which runs off "local" Tomcat) in its init() and draw (write) what the servlet returns ....
code in init() as follows:
URL url = new URL("http://localhost:8080/bt/servlet/TestServlet?name=TestApplet");
URLConnection connection = url.openConnection();
connection.setUseCaches(false);
connection.setDoOutput(true);
connection.setDoInput(true);
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
line = in.readLine();
in.close();
I understand the browser loads HTML and loads Applet and calls init().
When I use
<applet codebase="http://localhost:8080/bt/jsp" code="TestApplet.class" ></applet>
and loads the HTML from browser using
http://localhost ort/test.html
or
http://(ipnumber found by ipconfig on windows200) ort/test.html
everything is fine.
but as soon as I use
<applet codebase="http://(ipnumber found by ipconfig on windows200):8080/bt/jsp" code="TestApplet.class" ></applet>
applet's init method is called but servlet doesn't get called from Applet.
Can anyone shed some light on this,please?
I thought loopback address and my actual ip address is the same...
Thanks in advance

 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!