My problem is simple but I am confused with this please help me.
In a JSP, I am receiving an Attribute(idsList) from Servlet1 and I want to send this Attribute(idsList) to another servlet, Servlet2 but I can do this using session.setAttribute(). My trouble is, how can we send to Servlet2 in JSP itself?
Here is my code, but it's not working because the same request is used to set and get. Please do the favour.
In Servlet1:
request.setAttribute("idsList",idsList);---is null
In JSP
List<Integer> idsList =(List<Integer>)request.getAttribute("idsList");
System.out.println("size of ids list :"+idsList.size());
request.setAttribute("idsList",idsList);
In Servlet2 :
request.getAttribute("idsList");---is null