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
posted
0
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".