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,082,665
  • 372
  • 3,610
  • 3,555
japes Sophey
  • 487
  • 3
  • 8
  • 26

0 Answers0