Getting the system name from environmental variable

Hi all,

Is it possible to get the system name from environmatal variables with out running an applet. I have to get the name of the system where the user has opened the browser.

I deployed my application in tomcat server and say the server is running in a machine called "MyServer". I am accessing the application from another machine say "MyClient" through internet explorer. I have to get the system name as "MyClient" without running an applet.... Is it possible?

Any ideas...

[505 byte] By [nvraman_83a] at [2007-10-3 7:44:57]
# 1
Does this question actually relate to Java in any way? It's unclear how it does. You want something (I don't really understand what) and you want to do it in a browser.
cotton.ma at 2007-7-15 2:46:15 > top of Java-index,Java Essentials,Java Programming...
# 2

Sorry for not being clear!!

I have developed a small application in java and i have deployed that in tomcat server. I am accessing that application from a different machine. In my java program, if run try to get the system name from the environmental variable, it will be executed in the server and i will get the system name of the server. But i want to get the system name of the client.(i.e the name of the system where the user has opened the browser)... Am i clear atleast now?

nvraman_83a at 2007-7-15 2:46:15 > top of Java-index,Java Essentials,Java Programming...
# 3
> Am i clear atleast now?More or less. Why do you need this information? For what purpose are you planning to use it. Why will the IP address of the client not suffice?
cotton.ma at 2007-7-15 2:46:16 > top of Java-index,Java Essentials,Java Programming...
# 4

Thanks,

I am using that information for some authentication purpose. I am getting the user name and password of the user from a pop up. But i cannot get the system name from the user in the pop up. For authentication, i will append the system name with the username.

For example: System name : system001

Username: john

I need to concatinate these two as system001\john and check if he is a valid user...

nvraman_83a at 2007-7-15 2:46:16 > top of Java-index,Java Essentials,Java Programming...
# 5
Honestly I really wouldn't bother. If you must authenticate with the host machine then use the IP.The client hostname can be faked very easily. The IP cannot be (at least so easily).
cotton.ma at 2007-7-15 2:46:16 > top of Java-index,Java Essentials,Java Programming...
# 6
And i you don't like that answer then the other answer is actually pretty much the same anyway.Get the IP. Get the hostname for the IP.(This all can (and should) be done from the server side)
cotton.ma at 2007-7-15 2:46:16 > top of Java-index,Java Essentials,Java Programming...
# 7
I am sorry, i don't know how to get any information about the client machine from which the user is accessing the application. What should I use to get the IP address of the client system where the browser runs?
nvraman_83a at 2007-7-15 2:46:16 > top of Java-index,Java Essentials,Java Programming...
# 8

> I am sorry, i don't know how to get any information

> about the client machine from which the user is

> accessing the application. What should I use to get

> the IP address of the client system where the browser

> runs?

You will get this from the tomcat side. You understand this right?

cotton.ma at 2007-7-15 2:46:16 > top of Java-index,Java Essentials,Java Programming...
# 9
Anyway use the getRemoteAddr() method of your Servlet Request.
cotton.ma at 2007-7-15 2:46:16 > top of Java-index,Java Essentials,Java Programming...
# 10
Thank you very much... working on that now...
nvraman_83a at 2007-7-15 2:46:16 > top of Java-index,Java Essentials,Java Programming...