| Author |
Help: Client Computer Name in Servlet
|
Shams Pakistan
Greenhorn
Joined: Jun 06, 2011
Posts: 6
|
|
Hello,
Hope you are doing fine. We have an internet facing web application which is running on WebSphere. I would like to get the Client Computer Name within one of the Servlets, I believe I can get the IP address using but the IP address would be different each time a user invokes a Servlet. I need to maintain within our database USERID and Computer Name i.e. one USERID can have multiple Computer Names.
I believe I can not get the MAC address within Servlet but I was wondering if it is possible to get client computer name.
I would really appreciate any help
Thanks
Regards
|
 |
harshvardhan ojha
Ranch Hand
Joined: Jul 26, 2007
Posts: 157
|
|
try with
getRemoteHost(), which Returns the host name of the client sending the request. If the name is unknown, returns an empty string.
|
 |
Shams Pakistan
Greenhorn
Joined: Jun 06, 2011
Posts: 6
|
|
Hello harshvardhan ojha,
Thank you very much for your prompt reply. What do you mean when by if host is unknown?
Please advise.
Thanks
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14572
|
|
You can't get the MAC address - java or not - unless the source machine is on the same LAN segment as the server, much less off the open Internet. MAC addresses don't get transported across routers.
For a variety of reasons, the source IP addresses and hostnames of client computers is unreliable, when it's available at all.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Shams Pakistan
Greenhorn
Joined: Jun 06, 2011
Posts: 6
|
|
Hi Tim Holloway,
I am not trying to get the network card MAC address but rather the computer name. So are you saying that request.getRemoteHost() will not return the computer name of the client correctly?
Please advise
|
 |
 |
|
|
subject: Help: Client Computer Name in Servlet
|
|
|