request.setAttribute("p",Object),request.getAttribute("p");
如果用request,request的范围仅限于同一个request对象;如果使用了form的"action"或response.sendRedirect("xxx.html")等调转,则不再是同一个request对象,即用request.getAttribute("name")将取不到值。
要换成request.getRequestDispatcher("xxx.jsp").forward(request,response);才能共享request中数据
request获取对象中的问题
最新推荐文章于 2022-07-12 23:28:55 发布