This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Servlets and the fly likes cookies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "cookies" Watch "cookies" New topic


Sonal Jogi

Joined: Oct 19, 2004
Posts: 23

Despite checking for the cookie array to be null, the below code throws a nullpointer exception at random (once in 50 times). Could anybody please tell me the reason why?

Thanks in advance,

[EDIT code tags added by Dave]
[ February 17, 2005: Message edited by: David O'Meara ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

The stack trace should state which line the NPE is occuring on.
Post your stack trace.

Also, use the code button to wrap your code. This will preserve the formatting and make it much easier for us to read.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: cookies
It's not a secret anymore!