I have a servlet named "a.java" and I want to send data from a servlet to a jsp and another servlet.
I have the following code:
request.setAttribute("1",result);
RequestDispatcher d1 = request.getRequestDispatcher("b.jsp");
d1.forward(request, response);
RequestDispatcher d2 = request.getRequestDispatcher("c.java");
d2.forward(request, response);
"b.jsp" is working and getting data, but when I try to get some data in "c.java" with this code
List <Products> list = (List <Products>) request.getAttribute("1");
I get a null pointer exception, can someone help me?