Craig, Thanks for the prompt reply. I have in the past set up DataSources in Tomcat's server-config.xml. However, due to the nature of our production environment I don't want to edit this file. It's relatively important that my web apps are completely self contained.
Jonathan Wright ----- Original Message ----- From: "Craig McClanahan" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Friday, November 12, 2004 11:57 AM Subject: Re: JNDI > On Fri, 12 Nov 2004 11:46:22 +1300, Jonathan Wright > <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Just a quick question about JNDI in a Struts setting. I want to reduce the > > dependencies between objects in my app. Some objects that are not servlet > > aware need access to the ServletContext and DataSources. However rather than > > complicating matters and increasing the number of arguments I need to pass > > around I'm thinking of putting references to DataSources and the > > ServletContext into a JNDI context. > > > > Which JNDI SPI would you recommend for a simple object registry/store? What > > are the issues regarding the Referenceable interface? > > Why not use the JNDI naming context provided by your container? You > shouldn't have to be worried about implementing this -- just configure > the JNDI resources that you want to make available to your > application. > > For example, the instructions for using the naming context provided by Tomcat: > > http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html > > and specific info about using a data source provided by Tomcat: > > http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-how to.html > > Other servers will have their own mechanisms for configuring these things. > > Craig > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]