- 如果您要使用
forward
(jsp:foprward
或RequestDispatcher
)从一页到另一页,请使用request.setAttribute(..)
和request.getAttribute()
,因为您属于同一请求 - 如果您使用
redirect
(通过response.sendRedirect()
),请使用request.getSession().setAttribute(..)
和request.getSession().getAttribute()

forward(
jsp:foprward或
RequestDispatcher)从一页到另一页,请使用
request.setAttribute(..)和
request.getAttribute(),因为您属于同一请求
redirect(通过
response.sendRedirect()),请使用
request.getSession().setAttribute(..)和
request.getSession().getAttribute()