tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
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 <gabrielm@fx.ro>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> 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.

Craig


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message