On Wed, 10 Jul 2002, Keith Wannamaker wrote:

> Date: Wed, 10 Jul 2002 18:14:12 -0500
> From: Keith Wannamaker <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: RE: JNDI - What resources are loaded?
>
> I'm creating a J2EE application that contains serveral web applications.
> Is there a portable J2EE way to set up serveral global parameters in JNDI
> that can be accessed by all the web apps?  Or, is it necessary to duplicate
> all the parameters in each webapp's deployment descriptor?
>
> If it were simply a group of webapps for tomcat, I'd just put the parms
> in the tomcat conf/web.xml file.  I guess a better way to phrase the
> question is, what is the preferred place for jndi parms in j2ee that
> are scoped for the entire application?
>

J2EE specs don't require the ability to share resources in this way, so
there's no portability guarantee.  But Tomcat 4.1.x supports this.  In
server.xml, you put the resources in a <GlobalNamingResources> section at
the top of the file (or use the admin tool to configure them).  Then,
inside the <Context> element for each webapp, you use a <ResourceLink>
element that, in essence, acts like a symlink in the file system and
points at the shared global resource.  For example, you could share a
single connection pool across webapps this way.

Of course, whether the resources are shared or not is something the server
administrator cares about -- as far as the application developer is
concerned, it always looks like a locally configured resource.  So you can
even do things like initially share a connection pool, then decide to give
a particular webapp its own connection pool instead, with zero impact on
the application itself.

> Thanks for any info,
> Keith
>

Craig


>
> | -----Original Message-----
> | From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> | Sent: Thursday, June 27, 2002 7:02 PM
> | To: Tomcat Users List; [EMAIL PROTECTED]
> | Subject: Re: JNDI - What resources are loaded?
> |
> | You can certainly look at your own context, using the standard JNDI APIs
> |
> | For security reasons, you won't be able to see anybody else's context, or
> | modify the one that Tomcat sets up for you.
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to