It's not a secret anymore!
The moose likes JSP and the fly likes Null pointer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Null pointer" Watch "Null pointer" New topic

Null pointer

Karl Green

Joined: May 21, 2003
Posts: 12
I'm working on a simple JSP and I keep getting a null pointer.
My code is:
<% String slurry = request.getParameter("SLURRY");
String part = request.getParameter("PART");

String token = slurry;
StringTokenizer st = new StringTokenizer(token, ",");
The error states that StringTokenizer has a null pointer. I have tested 'slurry' and it has the string in it. What am I missing?
Sri Basavanahally
Ranch Hand

Joined: Oct 07, 2003
Posts: 75
Why are you assigning slurry to token ?

Karl Green

Joined: May 21, 2003
Posts: 12
The sample code that I based my JSP on had it that way. I've placed slurry in StringTokenizer, but I still get the null pointer.
I agree. Here's the link:
subject: Null pointer
It's not a secret anymore!