Pass '-DLOCALUSER=true' or set an environment to the Java VM. In your code you can check for the value using System.getProperty("LOCALUSER"). Features like the one you are describing are best implementing using environment variables.
> -----Original Message-----
> From: Jeremy W. Redmond [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 31, 2003 10:00 AM
> To: [EMAIL PROTECTED]
> Subject: How can I determine if user is running locally?
>
>
> 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
>
