This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Null pointer" Watch "Null pointer" New topic
Author

Null pointer

Karl Green
Greenhorn

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?
Thanks,
Karl
Sri Basavanahally
Ranch Hand

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


UP THE IRONS !
Karl Green
Greenhorn

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Null pointer
 
Similar Threads
request.getParameter()
parsing
how to cast array of Object
StringTokenizer
StringTokenizer and Loop Help