NullPointerException « Bean « JSP-Servlet Q&A





1. Null pointer exception when there is no value for numeric field in JSP    stackoverflow.com

I am using bean to validate the form of JSP. If use setProperty and if some fields on the form is left blank it is throwing a null pointer exception. This ...

2. Null pointer exceptions in bean - help!    coderanch.com

Please could anyone tell what's wrong with this? I get null pointer exceptions in findUser() at these 2 lines: userQuery = connection.prepareStatement( "SELECT * FROM user where user_name = ?" ); userQuery.setString(1, userName); I can't tell why. This is the code: // JavaBean to store data for a user package sonia.beans; import java.sql.*; import javax.servlet.http.*; public class UserBean implements HttpSessionBindingListener { ...