Re: getServerName returns 'localhost'

2010-03-03 Thread Cyrille Le Clerc
.24 > x-forwarded-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é Warni

RE: getServerName returns 'localhost'

2010-03-03 Thread vgud
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. >&

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/we

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 t

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 o

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? Maybe try this : >> >> www.example.com another.example.com athird.example.com >> (I mean s

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&#x

Re: getServerName returns 'localhost'

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

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? > > > > > > And your client goes to www.example.com, but you getServerName() returns > "localho

Re: getServerName returns 'localhost'

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

Re: getServerName returns 'localhost'

2010-03-03 Thread Ronald Klop
Did you do something like this in server.xml? 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 : Users use tomcat directly. My server r

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 s

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 remadr

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 whic

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 s

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 g