File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes null pointer exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "null pointer exception" Watch "null pointer exception" New topic

null pointer exception

Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
When I run the following code, I get this for output:
test2=after certifications
before calling certs=certs
before calling skills=sk
test3=after dates

If I comment out any references to req that occur after calling writeSkills, the program works. It seems that somewhere req is being set to null. Is there anything that I am missing?

Matthew Phillips
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
I found the problem. I was not accounting for getParameterValues returning null.
I agree. Here's the link:
subject: null pointer exception
It's not a secret anymore!