1

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);
BalusC
  • 1,040,783
  • 362
  • 3,548
  • 3,513
japes Sophey
  • 447
  • 1
  • 8
  • 23

0 Answers0