tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: The best place for implementing context specific behavior?
Date Fri, 26 Jun 2009 13:21:00 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan,

On 6/25/2009 12:04 PM, Jonathan Mast wrote:
> Haha thanks, Andre, I'm not lost but it seems other people might be.
> 
> I'm going to go ahead define separate hosts, although the <Alias> option
> mentioned might work, I don't know if it would preserve correctly the value
> returned by request.getLocalName() which is what I'm using for determining
> the host specific content, but if someone knows better than say so.

Don't use request.getLocalName: use request.getHeader("Server"). This
will avoid multiple copies of the webapp being deployed. It also might
be faster, as no DNS lookup needs to occur.

> The
> <Alias> element is kinda poorly documented on tomcat.apache.com, it only has
> a paragraph. Seems like a holdover from httpd configs....

That's because it's simple: you just put an alternative hostname into
the <Host> element so that it can match multiple hostnames without
having to have multiple <Host> elements.

I think you're making this all way more complicated than necessary.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkpEyzwACgkQ9CaO5/Lv0PCgbwCeLZpxRorULh4XxEcRe/L0QahM
uJ8AoKVAURPW6h4lYcZijdgq+wjODOQJ
=rwcz
-----END PGP SIGNATURE-----

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


Mime
View raw message