Thanks for the tip. It is actually a JSP Bean that gets the handle to the
servlet.
When you say "making a call to this servlet" do you mean calling it thru
HTTP?
I don't think that would work for me, since it returns a sql Connection....
Do you know why they deprecated it? Is there any other way to get a handle
to it?
Thanks,
Neal
> > The getServlet() method has been deprecated and can return null in new
> Servlet
> > engine implementation.
> > You might want to make a call to this servlet when the servlet engine
> starts or
> > write a method making a call to this servlet if the object is not
> available in the
> > servletContext.
> >
> > Olivier
> >
> > Neal Kaiser wrote:
> >
> > > I have a database pooling servlet which I need to load at startup
time
> then
> > > reference many times later. I've switched from JRun and am trying out
> > > OrionServer, but can't seem to get it to work. Here's my
> web-application.xml
> > > snippet:
> > >
> > > -------
> > > <servlet>
> > > <servlet-name>GlobalConnectionBroker</servlet-name>
> > >
> > >
>
<servlet-class>net.anythingcreative.db.GlobalConnectionBroker</servlet-class
> > >
> > > <init-param>
> > > <param-name>configfile</param-name>
> > >
> > > <param-value>/usr/local/jdk/ex/creative.cfg</param-value>
> > > </init-param>
> > > <load-on-startup></load-on-startup>
> > > </servlet>
> > > ------
> > >
> > > You'll notice that I'm calling it "GlobalConnectionBroker", and
that's
> the
> > > name I use to reference it later.
> > >
> > > Here's my site.log, you can see that it is loaded:
> > > ---
> > > 10/22/99 8:50 AM Started
> > > 10/22/99 8:50 AM net.anythingcreative.db.GlobalConnectionBroker: init
> > > 10/22/99 8:50 AM globalBroker is loaded:
> > > net.anythingcreative.db.DbConnectionBroker@40074b41
> > > 10/22/99 8:50 AM com.evermind.servlet.XSLServlet: init
> > > -----
> > > However, I don't understand why it is saying "globalBroker"? That
is
> just
> > > a
> > > variable for a class that GlobalConnectionBroker loads....
> > >
> > > Anyway, here is my code that tries to grab a handle to the
> > > GlobalConnectionBroker, but it always returns null:
> > >
> > > Servlet servlet = null;
> > > try {
> > > servlet = (GlobalConnectionBroker)
> > > application.getServlet("GlobalConnectionBroker");
> > > } catch (Exception e) {
> > > application.log("Exception: " + e);
> > > return null;
> > > }
> > >
> > > conServlet = (GlobalConnectionBroker) servlet;
> > > if (conServlet == null) {
> > > // it always returns null here.......
> > > return null;
> > > }
> > >
> > > Does anyone have any ideas?
> > >
> > >
>
===========================================================================
> > > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > > FAQs on JSP can be found at:
> > > http://java.sun.com/products/jsp/faq.html
> > > http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> >
>
===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > FAQs on JSP can be found at:
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html