How can I determine if user is running locally?

"Jeremy W. Redmond" <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
Hello -
   When writing the code for our system, developers try to write the code in a way that will involve the least amount of tweaking when deploying from local machine, to production.  I was wondering if it is possible to determine whether or not the user is running locally (possibly using the HOSTS file in Windows) or not.


Since the applications may be distributed to many different locations, I cannot simply check the IP address and attempt to match the first few digits since these may be different on everyone's machine.
(unfortunately this is how I am currently doing it...)

If worse comes to worse, I could REQUIRE the user to use "localhost:7001"
when running locally, but I was wondering if there is a more clever way to do this.  All I could come up with is possibly reading the HOSTS file.

Any feedback woould be appreciated.

Jeremy

___________________________________________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.