Two things:
1.) Avoid using the == operator for comparing strings.
It may not return the results you're expecting.
Use the
String object's compare() method instead.
If you're not sure why, ask about this in our
Java In General (Beginner) forum. This is a common issue folks run into when starting out with Java.
2.) Check your server's logs to see exactly where the NullPointerException is being thrown. Once you know this, it should be easy for you to come up with a fix. If not, pointing us to the specific line number will make it easier (read: more likely) for us to help you.