Doesn't really make a difference.
java: selects a particular context, in that context '/comp' and 'comp'
are the same, except '/comp' has a composite name {"","comp"} while
"comp" is just {"comp"}.
BTW //comp should also work, since {"","","comp"} is equivalent.
arkin
Tim Endres wrote:
>
> > > InitialContext ctx;
> > >
> > > ctx = new InitialContext();
> > > myVar = ctx.lookup( "java:/comp/env/my-var" );
> >
> > Actually, according to the spec. that should be "java:comp/env/my-var".
> > Which is a bit weird IMHO. Why use relative names ("java:comp/env")
> > instead of an absolute name ("java:/comp/env"). It doesn't really make
> > sense to have relative ones I think. Also, if the namespace is flat,
> > then the one that is (IMHO) intuitively right, i.e. "java:/comp/env",
> > will fail on lookup.
>
> I would venture the thought that went into that was as follows; the
> 'java:' prefix actually specifies a Context, and the path is relative
> to that context.
>
> tim.
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".