-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan,

On 6/24/2009 5:13 PM, Jonathan Mast wrote:
> Andre, its one single, physical app/docBase, mapped to multiple contexts
> (which happen to located on different virtual hosts).  This is a
> requirement.
> 
> The /META-INF/context.xml approach is ruled out by this requirement.

If you need to have only a single deployed webapp to handle requests for
all of these different domain names, then your webapp will necessarily
have to detect the hostname being used /for each request/. This is not
terribly inefficient: it's just grabbing a header value.

This kind of thing smells like private-labeling. The best technique I
can think of is to sniff the hostname at the beginning of the request
(use a filter?) and stuff something into the request attributes that
represents the "profile" for that flavor of fruit (or private label).
Then, when rendering your pages, or making database connections or
whatever, reference the profile in the request attributes to make
decisions as to how things should go.

If request attributes aren't your thing (many reasons including "my
database code doesn't have access to the request", etc.), then you can
use ThreadLocal variables. Just remember to catch all exceptions in your
filter and /remove that damned profile object from the ThreadLocal/ or
you can have security and/or memory problems.

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

iEYEARECAAYFAkpCovEACgkQ9CaO5/Lv0PC1+ACfXpjMl3TV7TMCt48/VzjYcngL
VRQAoMEiEtjZdGBeKYqxagBW4fyIDz69
=ydr2
-----END PGP SIGNATURE-----

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

Reply via email to