This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Firstly, no one writes that much scriptlet code in a JSP, you are defying the entire JSP purpose.
Did you see the stack trace to find out what part of the code is throwing the NPE?
Moreover the idea of submitting the entire JSP is not really good, do you want the DB code to go over again?
You need AJAX.