rotem_fo
asked on
InetAddress and Java 1.3
Hi,
I am developing a Applet and i want to get the host name of the computer i an running the applet on.
When i use JApplet.getCodeBase().getH ost() I receive localhost instead of the server name.
When i use InetAddress.getLocalHost() .getHostNa me() i get the same.
Any ideas ???
Thanx.
I am developing a Applet and i want to get the host name of the computer i an running the applet on.
When i use JApplet.getCodeBase().getH
When i use InetAddress.getLocalHost()
Any ideas ???
Thanx.
probably you download that applet from your PC. (a web server take it from there)
Firstly the two thing you are try are different:
JApplet.getCodeBase().getH ost()
Returns the host of the server where the applet was loaded.
InetAddress.getLocalHost() .getHostNa me()
Returns the hostname of the client. This information is not accessible to unsigned applets and thus it is returning 'localhost' You need to sign the applet to be able to find the local hostname.
JApplet.getCodeBase().getH
Returns the host of the server where the applet was loaded.
InetAddress.getLocalHost()
Returns the hostname of the client. This information is not accessible to unsigned applets and thus it is returning 'localhost' You need to sign the applet to be able to find the local hostname.
ASKER
Hi,
I used getCodeBase().getHost() .
Whenever i type the server's name in the address bar (in the internet explorer) i receive the machine name, if i type the ip address the getCodeBase().getHost() returns the ip entered in the address bar.
I am lost :(
R.
I used getCodeBase().getHost() .
Whenever i type the server's name in the address bar (in the internet explorer) i receive the machine name, if i type the ip address the getCodeBase().getHost() returns the ip entered in the address bar.
I am lost :(
R.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
rotem_fo:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- Split points between objects and dviji
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Venabili
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
- Split points between objects and dviji
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Venabili
EE Cleanup Volunteer