Hi Fei,
 
Thanks for helping out.  Isn't that what I was doing with this call:
 
pageContext.getAttribute("dbPool", pageContext.APPLICATION_SCOPE);


>>> [EMAIL PROTECTED] 09/24/02 12:27PM >>>
Hi Jason,
 
use this:
pageContext.getAttribute(name, scope)
scope = page, request, session and application. In your case, application.
 
Fei Li
----- Original Message -----
Sent: Tuesday, September 24, 2002 9:29 AM
Subject: Custom Tag retrieving ServletContext Objext

Hi Everyone,
 
This may be a stupid question but I'm just starting to use custom tags and I'm running into a strange problem.  I'm using a DBCP for a mySQL database and my setup servlet places a handle to the pool in the ServletContext via the setAttribute() under the name "dbPool."

Now other servlets can retrieve the pool handle fine and get a connection and do their business.  However my tag, which extends TagSupport can't seem to find the pool.  Initially, I used getServletContext.getAttribute("dbPool").  Of course, I got a compile error telling me that there is no such method.

After some reading, it appeared that what I'm looking for should be available via
the pageContext.getAttribute("dbPool",pageContext.APPLICATION_SCOPE);

However, I'm still not getting a handle on the DB Pool.  I know there's probably somethings fairly simple I'm missing here, either syntax or concept.  Could someone give me some insight. 
 
Thanks for your time,
Jason

Reply via email to