Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Null pointer  RSS feed

 
Karl Green
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you assigning slurry to token ?
 
Karl Green
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!