2009-05-27

JSP web page 間 arraylist 資料傳遞

用request傳遞:
jsp1:
request.setAttribute("a",obj);
application.getRequestDispatcher(request,response).forward("xxx.jsp");
jsp2:
Xxx xx=(Xxx)request.getAttribute("a");

用session伝遞:
jsp1:
session.setAttribute("a",obj);
jsp2:
Xxx xx=(Xxx)session.getAttribute("a");

沒有留言: