This content has been marked as final.
Show 2 replies
-
1. Re: Problem with storing a value into session object
darranl Oct 18, 2004 4:52 AM (in response to thoste)Show the stack trace, does the NullPointerException originate in your code or outside your code?
-
2. Re: Problem with storing a value into session object
trickal Oct 19, 2004 5:48 AM (in response to thoste)Hi Thomas,
you wrote:(1) String firstVisit = (String) session.getAttribute("firstVisit"); (2) if (firstVisit.equals("")) { (3) ... (4) }
If a user is visitting your page the first time, firstVisit is null after the first line. So you're trying to check if null is equal to "" in line 2. This results in a NullPointerException.
Thomas