tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: one context per server
Date Tue, 18 Jun 2002 21:58:00 GMT

On Wed, 19 Jun 2002, Gabriel Mihalache wrote:

> Date: Wed, 19 Jun 2002 00:52:30 +0300
> From: Gabriel Mihalache <>
> Reply-To: Tomcat Users List <>
> To: Tomcat Users List <>
> Subject: one context per server
> is there a way to share a single JNDI context for all webapps?

Not with the standard implementation -- the JNDI context that Tomcat
provides is populated with the resources for that webapp, which can
potentially all be different.

With Tomcat 4.1.x, you can pretty easily share JNDI-accessed resources by
putting them in the <GlobalJNDIResources> element of server.xml, and
creating a <ResourceLink> element for each webapp -- so, for example, you
could declare a data source once and use it in multiple apps.

> can this context be accesible thru getServletContext() ?!

Nothing stops you from storing the JNDI initial context you get back as a
servlet context attribute, but it seems redundant to me -- the thing is
already accessible from anywhere in your code.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message