从servlet设置参数到JSP中需用session设置,这样在JSP中才可以获取到值,否则都是NULL
例如:
在servlet中设置:
request.getSession().setAttribute("showInfoList", showInfoArrayList);
在JSP中接收:
ArrayList showInfo = new ArrayList(); showInfo = (ArrayList)request.getSession().getAttribute("showInfoList");
原因:
servlet是用的response.sendRedirect("../ShowInfo.jsp");进行的重定向,只有session后才能有值