vgud wrote:
Users use tomcat directly.

My server responds to different domain names, and I want to know which one
users use. I try to get domain name by request.getServerName() but instead
of domainName.com I get 'localhost'.

Look up the java doc for HttpRequest.
You should probably use remadr = request.getRemoteAddress() or something like that. That will give you the IP of the client, not your own IP. Then you should use a DNS lookup (I mean the equivalent Java function) to translate the remote IP into the corresponding remote name.

request.getServerName() probably gives you the name of your own server (the one which is in the <Host> tag of your server.xml config file.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to