Guys' suggest to do the JNDI env setup in the servlet's init() method is
a good solution, since that method will only be called once during the
lifetime of the servlet (i.e. creation time).  One might also think it
could be ok to get the InitialContext and store it in an instance
variable of the servlet, although this is maybe not very thread safe.

Ken Jenks wrote:
> 
> At 03:53 PM 08/07/2000 -0400, you wrote:
> >I was taking a look at the jboss documentation for setting up properties for
> >defining the JNDI content, but I think I see something that is inefficient.
> >In the doGet() there is a :
> >
> >"
> >// Set up the naming provider; this may not always be necessary, depending
> >// on how your Java system is configured.
> >System.setProperty("java.naming.factory.initial",
> >"org.jnp.interfaces.NamingContextFactory");
> >System.setProperty("java.naming.provider.url", "localhost:1099");  "
> 
> That servlet was my very rough, very quick hack. It's actually the first
> EJB client I ever wrote. It's not pretty. It's not efficient. Its sole
> virtue is that it works.
> 
> Please suggest something better. I won't feel slighted.
> 
> -- Ken Jenks, http://abiblion.com/
> 
>     Tools for reading.
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]

-- 
Jeffrey & Nikole Bonevich
Maxmillian Bonevich
Ann Arbor, Michigan
[EMAIL PROTECTED]
http://www.bonevich.com


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to