Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null pointer

 
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic