cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BURGHARD Éric <eric.burgh...@systheo.com>
Subject Re: Absolutizing with request.getServerName() (was: Protocol switch...)
Date Wed, 21 Sep 2005 12:41:22 GMT
Bertrand Delacretaz wrote:

> Le 21 sept. 05, à 14:04, BURGHARD Éric a écrit :
>> ....If i understand correctly, the request.getServerName() is not
>> useable for
>> absolutisation since it names the server in his local environnement..
> 
> Did you follow Vadim's advice earlier in this thread?
> 
> Le 19 sept. 05, à 14:45, Vadim Gritsenko a écrit :
>> ...Use ProxyPreserveHost
>>
>> http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypreservehost
> 
> I think request.getServerName() should return the correct value then.
> 

Yes but for me it's going to far in virtual host or http server
configuration and it's tied to a particular http server configuration.

getServerName() apparently
"Returns the host name of the server that received the request"
which not what you want i guess.

getHeader('Host') is preferable as it returns the name that appears in the
client's browser.

for me a prefix constructed from sitemap with
<map:parameter name="site"
value="{request:scheme}://{request-header:Host}/{request:contextPath}"/>
seems to work well to absolutize my urls (i'm using apache+tomcat5).

Regards.


Mime
View raw message