Kevin Duffey wrote:
> Craig..can't you use the javax.jndi.naming or something like that? I was
> messing around with that yesterday a bit, but don't have much knowledge on
> it yet. Someone on the Orion team mentioned that its possible to share
> global data across web-app contexts using that mechanism, or something like
> it. Any info on that?
>
Yes ... JNDI would be the way to access an LDAP-based directory server, for example
(in the same way that you would use JDBC to talk to a database). In either case,
if you configured the two webapps to talk to the same server, they can use that
server to share information.
It is feasible for a particular app server to provide JNDI access to shared
information across webapps within the same JVM, which would generally be faster
than going to an external server. However, this would be a feature of the
particular environment you are running in, not something you could count on having
everywhere.
In the J2EE environment, a servlet container that is part of a J2EE server is
required to provide a JNDI context for looking up things that were declared with
<env-entry>, <resource-ref>, and <ejb-ref> elements in the web.xml file. But the
"java:comp/env" context that is returned here is unique per web-app, so it does not
help you accomplish cross-app sharing.
Craig McClanahan
>
> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, September 08, 2000 11:19 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: is HttpSession only good in one servlet context???
> >
> >
> > hua ge wrote:
> >
> > > Hi,
> > > I have couple servlet context mapped in the web server.
> > > in servlet 1(in context 1) I stored some object in the
> > session, then servlet
> > > 2(in context 2) will reference the object stored in the
> > session object
> > > created in context1.
> > >
> > > I could not get the data out from session object because I
> > am crossing
> > > different context.
> > >
> > > how can I do session tracking crossing multiple context?
> > >
> >
> > You don't. The servlet specification requires that sessions
> > are scoped per
> > context.
> >
> > If you want to share information between different contexts,
> > you should use some
> > external mechanism like databases, LDAP servers, shared disk
> > files, RMI/CORBA
> > servers, etc.
> >
> > Craig McClanahan
> >
> > ====================
> > See you at ApacheCon Europe <http://www.apachecon.com>!
> > Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing
> > Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ
> > Applications to Tomcat
> >
> > ==============================================================
> > =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with body:
> > "signoff JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
--
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing
Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ
Applications to Tomcat
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets