Stefan Frei wrote:
do you see a entry point where to start ?
i already have a customRealm

I would look at the problem in a different way, and set up 3 virtual hosts, one for each country. Then it is just a configuration change, nothing in the code.



2013/12/2 Christopher Schultz <ch...@christopherschultz.net>:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Stefani,

On 12/2/13, 2:23 PM, Stefan Frei wrote:
tomcat 7.0.42

debian

I have the same webapplication responsible for providing services
fro three different countries.

Therefore 3 slightly different database schemes exist on my mysql
instance.

one for ch(switzerland), one for de(germany) and one for
at(austria).

now my auth-realm which extends RealmBase should be able to decide
to which schema to connect to, depending on the requested url.

for example requests to webapp.ch should use the table users in
schema ch.

how am i able to read out httprequest or session in the realm to
identify for which country the request is destined?
The short answer is that you can't, at least with Tomcat's stock Realm
implementations.

You can hack your own Realm, but you'll also need to hack around a bit
more, since the Realm itself doesn't get any access to the servlet
request information.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSnQpPAAoJEBzwKT+lPKRYOV0QAJ0ZkCM4eFRrEOX5dbJyXgYK
evyIEKju8jd6N3rbOfWx3XKua0Nau0H18Yb6gCrQc94OGyHTJFP1gfPkDL4eTaHu
FXQJvWgrNUjHHifXaNmcATef6GeHhchSply6KbP0s8uYjINgS3eGCUJmk6mS0ZU+
W7VMIXE184kaQcOYJ6OIFwFhGkEuMEajRa7iGkWxQYxhi9VCXgb8a0hZ9uLO00rm
Nt/J54G2aE32UTNhEti0sBIwJC9pnddsV9WWv84jSBN/FhKNf5fHc7CskpB9wRGR
mwSHFhiKpZv60MnswiN9DO2vvCkNBhSE7XSaj/aBsw6aOkxV8w4zE+FbogoFDZZU
yDqY/kY4LH5tAfddx+9w7shtLsYlgpC8NjF5KMURuJuhw8TOvd3+vzzRq2gEB2Zs
iseOnfGAvwd1EVZacaMgmaCbqCFcsUvAFx2j4/f5CX1CcPOQT4hE7Tu+UCTbIzGA
JY3NduFCWR1k9qG07wGtyAP2osz6C9seDYI059Vu5YsOT7V8NpsTROKi+34kMjs4
wI1J3TqYaJ/2WHMKGvH1r8+2LUg7R5PPBuUrQ4eanU5t1fKmzr7f8VDrOtW1PLW/
TYg/R9LfX88+u5/L6LqUomC7+mJ1dkihDmel6yM4bgEna6vV2kbw4ro/CCQWvJOj
MlrsH8tRc7Ven339Wj0S
=Ps8Q
-----END PGP SIGNATURE-----

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


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




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

Reply via email to