tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Crowther <peter.crowt...@melandra.com>
Subject Re: getServerName returns 'localhost'
Date Wed, 03 Mar 2010 14:07:37 GMT
On 3 March 2010 13:47, André Warnier <aw@ice-sa.com> wrote:
> André Warnier wrote:
>> vgud wrote:
>>> My server responds to different domain names, and I want to know which
>>> one users use.
[...]
> More precisely :
>
> getRemoteAddr
>
> public java.lang.String getRemoteAddr()
>
>    Returns the Internet Protocol (IP) address of the client or last proxy
> that sent the request. For HTTP servlets, same as the value of the CGI
> variable REMOTE_ADDR.

Andre, you're answering the question of "which client sent this request?"

The OP is asking a different question: "What hostname did the client
send this request to?"

I'd parse the host header in the request to find out, but that's just me!

- Peter

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


Mime
View raw message