hey 

Is the initialization working properly? are you able
to see that the database conneciton is being achieved
and is being passed over. Then the next thing would be
to check for the session, may be the session is
getting invalidated and hence when you try to retrieve
the Connection, it gets null. 

can help you if you tell me something about the above
Kris


--- [EMAIL PROTECTED] wrote:
> Hi, I have a problem I have been trying to solve for
> a very long time. I 
> first have a initialization servlet set by
> <load_on_startup> tag. In this 
> servlet I create a database connection and pass it
> to the ServletContext like 
> this.
> 
>
getServletContext().setAttribute("dbConnection",dbConnection);
> 
> Now the problem is how do I retrieve it from a jsp
> page. From by research, 
> reading through books it shows how to get an
> attribute using : jsp:useBean 
> action. However this is done if Beans/Objects are
> put into the setAttribute. 
> In my case it is a database connection object. How
> do I retrieve this from a 
> jsp page???
> I tried (in a jsp page);
> <% Connection connection =
> getServletContext().getAttribute("dbConnection"); 
> %>
> but this returns a null. Connection never gets set..
> If someone can help me please......


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to