getServerName returns 'localhost'

2010-03-03 Thread vgud
Gentlemen, I have the application which could be accessed from different domain addresses and I need to know from what domain request was sent. I try to get following from request: getRemoteHost: 127.0.0.1 getServerName: localhost I use tomcat 5.5 and I suppose i should configure something to

Re: getServerName returns 'localhost'

2010-03-03 Thread André Warnier
vgud wrote: Gentlemen, I have the application which could be accessed from different domain addresses and I need to know from what domain request was sent. I try to get following from request: getRemoteHost: 127.0.0.1 getServerName: localhost I use tomcat 5.5 and I suppose i should configure

Re: getServerName returns 'localhost'

2010-03-03 Thread vgud
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'. awarnier wrote: vgud wrote: Gentlemen, I have the application which could

Re: getServerName returns 'localhost'

2010-03-03 Thread André Warnier
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

Re: getServerName returns 'localhost'

2010-03-03 Thread André Warnier
André Warnier wrote: 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

Re: getServerName returns 'localhost'

2010-03-03 Thread Ronald Klop
Did you do something like this in server.xml? Engine defaultHost=localhost Host name=localhost / /Engine And your client goes to www.example.com, but you getServerName() returns localhost in stead of www.example.com? Ronald. Op woensdag, 3 maart 2010 14:19 schreef vgud ivan.gudi

Re: getServerName returns 'localhost'

2010-03-03 Thread Peter Crowther
On 3 March 2010 13:47, André Warnier a...@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

Re: getServerName returns 'localhost'

2010-03-03 Thread vgud
Exactly. So, could it be configured somehow to make me able get correct domain? Ronald Klop wrote: Did you do something like this in server.xml? Engine defaultHost=localhost Host name=localhost / /Engine And your client goes to www.example.com, but you getServerName() returns

Re: getServerName returns 'localhost'

2010-03-03 Thread André Warnier
Peter Crowther wrote: On 3 March 2010 13:47, André Warnier a...@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

RE: getServerName returns 'localhost'

2010-03-03 Thread Caldarale, Charles R
From: vgud [mailto:ivan.gudi...@yahoo.com] Subject: Re: getServerName returns 'localhost' So, could it be configured somehow to make me able get correct domain? Only if you added all possible domain names and variations thereof that get to that system's IP address(es). As Peter suggests

Re: getServerName returns 'localhost'

2010-03-03 Thread André Warnier
vgud wrote: Exactly. So, could it be configured somehow to make me able get correct domain? Ronald Klop wrote: Did you do something like this in server.xml? Engine defaultHost=localhost Host name=localhost / /Engine Maybe try this : Engine defaultHost=localhost Host name=localhost

Re: getServerName returns 'localhost'

2010-03-03 Thread Konstantin Kolinko
1. What, exactly, version of 5.5.x is used. 2. Is Tomcat running standalone, or is behind Apache HTTPD, IIS or other web server, or a load balancer 3. What connectors are configured in server.xml? What connectors (protocols) are mentioned in catalina.log at startup time. E.g.: 03.02.2010 12:10:01

RE: getServerName returns 'localhost'

2010-03-03 Thread Caldarale, Charles R
From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: getServerName returns 'localhost' public java.lang.String getServerName() Returns the host name of the server to which the request was sent. It is the value of the part before : in the Host header value, if any, or the resolved

RE: getServerName returns 'localhost'

2010-03-03 Thread Caldarale, Charles R
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Subject: RE: getServerName returns 'localhost' The code shows that the HOST header is being used by getServerName(). Testing with the RequestDumperFilter enabled in examples/WEB- INF/web.xml shows that it works as documented

RE: getServerName returns 'localhost'

2010-03-03 Thread vgud
it is configured? n828cl wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: getServerName returns 'localhost' public java.lang.String getServerName() Returns the host name of the server to which the request was sent. It is the value of the part before : in the Host header value

Re: getServerName returns 'localhost'

2010-03-03 Thread Cyrille Le Clerc
-host : myRealDomain.com x-forwarded-server : my.server.ip.address So, tomcat(or someone else) does some forwarding and attach those headers on request? If so where and how it is configured? n828cl wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: getServerName returns