Browsers send nothing if a checkbox is unchecked.
This means that getParameter will return null in that case.
Null pointers don't have an .equals(..) method.
You'll need to either check for null before trying to call equals or just check for null. Another alternative is to turn the
test around.
Since the
string literal "on" will always be a valid string, you can call its equals method instead of trying to call it on the results from getParameter.