I'm pretty new to java. I'm getting java.lang.NullPointerException error when trying to run my servlet on the server. Can someone advise what the problem is the way I have called getAllStaff?
static StaffDAO dao = new StaffDAO();
static ArrayList<Staff> staffList = null;
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
staffList = dao.getAllStaff();
request.setAttribute("staff", staffList);