How can I pass an ArrayList from one servlet another?
问题 I have already sent arraylist1 from one servlet to another. It works. Now I want to pass arraylist2 to another jsp/servlet, but I get an error: java.util.nullPointer Exception . How can I resolve this? 回答1: RequestDispatcher disp2 = request.getRequestDispatcher("NewServlet.java"); should be RequestDispatcher disp2 = request.getRequestDispatcher(pathToYourServlet); The path is the end of the page adress: http://localhost/yourApp/ pathToYourServlet 回答2: You need to look at the full stack trace