This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointer Exception...

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
String [] paramvalues = req.getParameterValues("p");
out.println(paramvalues.length);
the first line throws NullPointer Exception why is it so??
What should I do to avoid this error?
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Silly:
String [] paramvalues = req.getParameterValues("p");
out.println(paramvalues.length);
the first line throws NullPointer Exception why is it so??
What should I do to avoid this error?

This happens because there's no parameter with the name "p" in the request object. The parameter of getParameterValues() is case sensitive. You may want to try using "P" instead of "p".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic