tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hunter Hillegas <hhille...@jacobstern.com>
Subject Retrieving Objects from the Session Results in a Null Pointer
Date Tue, 15 Aug 2000 16:18:17 GMT
I have this code:

<%
theSession = request.getSession(false);

shoppingCart cart = null;

try {
    cart = (shoppingCart)theSession.getValue("shoppingCart"); //This is
causing a null pointer exception. Arghhhh...
}
catch (Exception e) {
    e.printStackTrace();
}
%>

that pulls an object out of the session...

I can verify that the object is in the session. I can grab it from the page
I inserted it from with this code:

shoppingCart testCart = (shoppingCart)theSession.getValue("shoppingCart");

I just can't get it from any other pages...

Any ideas?


Hunter Hillegas, MCP
Web Engineer / System Administrator - Jacob Stern & Sons, Inc.
hhillegas@jacobstern.com
805-565-1411 PH * 805-565-8684 FAX


Mime
View raw message