Hi Louis,

I have the impression you're confusing things. 'setAttribute' was not yet
defined in Servlet API 2.0 (package included in JSDK2.0). That method is an
addition to Servlet API 2.1 (package included in JSDK2.1 or JSWDK 1.x). Because
of implementation differences you're going to have a hard time using the 2.1 API
package with software developed for the 2.0 API.

In order for us to be able to use Apache JServ 1.0 we DOWNGRADED our servlets
from 2.1 to 2.0. But, this is not always possible.

regards,
 Danny Martens

louis mechery wrote:

> Thanks to all of you who responded to my question.
> I am not sure whether you are aware of ORACLE's JDEVELPER2.0. Anyway, I will
> come to the point. The JDEVELOPER2.0 comes with JDK1.1.7, JSDK2.0. I don't
> which release of JSDK2.0 that comes with.
>
> As many of you suggested me to use the following method.
> getServletContext().setAttribute("connection_pool", pool).
> I am getting a COMPILATION ERROR: "method setAttribute not found in
> interface javax.servlet.ServletContext".
>
> Will you please tell me WHICH RELEASE of JSDK2.0 I can download?
>
> Thanks in advance.
> Louis
>
> >From: Craig McClanahan <[EMAIL PROTECTED]>
> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> >        Servlet API Technology." <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: unable to execute ServletContext
> >Date: Mon, 25 Oct 1999 16:45:27 -0700
> >
> >Louis Mechery wrote:
> >
> > > Hi All,
> > >
> > > I am new to Java servlet. I have successfully added and loaded a
> >ConnectionPool servlet (database.ConnectionServlet) on the java web server
> >2.0.
> > > I want to test the connectionServlet using another servlet
> >"TestConnectionServlet". But, I get an error "ConnectionServlet not found"
> >while executing the following code. Hope some one can answer to my
> >question. Thanks in advance.
> >
> >As of the servlet 2.1 API (which I'm pretty sure that JWS 2.0 implements),
> >the "getServlet()" method has been deprecated, and required to return null.
> >  This was done for valid security reasons that are beyond the scope of
> >this discussion.  The bottom line is that it is no longer possible for one
> >servlet to get a reference to an instance of any other servlet -- so you
> >cannot access another servlet's methods or instance variables.
> >
> >If you want to share objects between servlets, an easy way to do so is
> >store them in the servlet context attributes.  For example, in the servlet
> >that initially creates your connection pool you could do something like
> >this:
> >
> >     ConnectionPool pool = ....;    // Create a new pool
> >     getServletContext().setAttribute("connection_pool", pool);
> >
> >And in every other servlet in your application, whenever you needed to get
> >a connection, you could do this:
> >
> >     ConnectionPool pool =
> >       (ConnectionPool)
> >getServletContext().getAttribute("connection_pool");
> >     Connection conn =
> >       pool.allocate();    // Or whatever the right call for your pool is
> >
> >Craig McClanahan
> >
> >___________________________________________________________________________
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >Resources: http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to