Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

applet init not calling doGet  RSS feed

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();
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
line = in.readLine();
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
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

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!