Mark,

On 28.06.2015 19:58, Mark Eggers wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christian,

On 6/28/2015 9:01 AM, Christian wrote:
Hello all,

is it somehow possible to create a web application with multiple
servlets that are registered to different domains for the same url
paths using tomcat 8? I already crawled through the catalina code
that is responsible for the servlet selection and didn't find
anything that would allow this. But this doesn't mean that it
isn't possible at all. As far as I know, java configuration for
servlet registration doesn't allow passing domain names. But maybe
there is an option within context.xml.

I want to create a web application that has different domains for
the application itself and its management site. Both parts should
run at the context root, at different domains. The application
needs a shared (spring-)context in which the application's beans
are stored.

Regards, Christian
I'm not quite sure what your after. Sharing Spring beans across
contexts and domains sounds like there's an underlying requirement I
don't understand.

ok, I'll try to explain, as aliases won't do what I need.
It's an application that can be configured via an admin interface. The admin interface is one part of the webapp. The main application is accessible via www.example.com. The admin interface needs access to the beans within the main application (e. g. to create tenants that live in context scope), that's why I created just one webapp with two dispatcher servlets. One dispatcher servlet is responsible for the admin interface and one for the main application. Until now I make tomcat select them by using a context path for the admin interface. But this is redundant, because the admin interface needs to be accessed via admin.example.com/admin instead of just admin.example.com. I would like to map admin.example.com to the admin servlet and www.example.com to the main applications dispatcher servlet. At a later stage, www.example.com/admin might be used for other admin tasks that must be accessible by users registered on the main site. But /admin is already shadowed.

Hopefully I could explain my problem a little better.

Regards,
Christian

Anyway, how about using aliases?

<Host name="first.host.name">
    <Alias>second.host.name</Alias>
</Host>

. . . just my two cents
/mde/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJVkDWnAAoJEEFGbsYNeTwtXUsIAKFQ2UitPMWeI8PGPrDIrrIQ
czJu0kCmE2J/cBQx28ghvvMZEBJ7EI7926Q7/a4e4TASXT3J3gka/2RYkeGy0w/0
P0PLTCpAGIJi+v4PyZ9lNj7f/gAcU60g4EiaNz/10HTbBcFwy1W/vLg2wl54+aNt
C6Z+3YWtaCNCDjon1PcqMTOKqDkkDjcf+ePXQiUdEIqI6wquBY0xIKkwPZtbjV+G
hkq2tAFqzdvW4fGk16Cv6FfZJrYDVqEYCK/TyO08FEbgXtIhflIWYU+pmJ9b8Jdr
xppp26doG3MeZMw4t9uijkRhe22PdXI73tvHiptc92V03p+Fmej8SrJZoKPPj78=
=6QWg
-----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

Reply via email to