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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
-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
16 matches
Mail list logo