File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes NullPointer Exception... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "NullPointer Exception..." Watch "NullPointer Exception..." New topic
Author

NullPointer Exception...

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Nov 22, 2008
Posts: 18944
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
 
subject: NullPointer Exception...
 
Similar Threads
JSP and request variables
another mock exam question
[newbie] Null pointer exception ??
@Autowire is not working properly in my spring application
validation problem