Message UK wrote:

> I'm using JSDK 2.1 and when I run servlets I have to connect to the internet
> in order to be able to establish a connection to my localhost...it's odd. I
> can immediately disconnect after the connection is made to my ISP, and the
> localhost server continues to work. I think it has something to do with
> "going online" - i.e. working offline in IE5 equals no server even if
> local??
>

What's going on is this:  whenever you use a host name in a URL, it needs to be
looked up in a "Domain Name Service".  Most ISPs have you configure your dial-up
networking connection to use the ISP's name server for this, which of course
only works when you are online.

Once the name "localhost" is looked up and turned into its IP address equivalent
(127.0.0.1), you can disconnect and continue working, because your PC remembers
this translation -- well, at least until you reboot.

To make it work without having to connect, you can try one of the following
approaches:

*   Connect with the IP address instead:

        http://127.0.0.1:8080/my/servlet

*   Add the following line to c:\Windows\HOSTS (on Unix systems, /etc/hosts)

        127.0.0.1        localhost

Your computer's TCP/IP stack should look here first, so it will know how to
translate "localhost" without having to be online.


Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to