1. sendRedirect

  • response.sendRedirect();
  • Server follow the logic, send a link to browser and browser will invoke the link with previous session, request again; The request.setAttribute can’t use.

2. include:

  • Will show the content of current page and included page, and the address link not change. And the reques.setAttribute can use
  • Servlet: request.getRequestDispatcher(“jsp2.jsp”).include(request, response);
  • JSP: <jsp:include page=”include.jsp”/>

3. forward:

  • Will show the content of forward page, and the address link not change. And the reques.setAttribute can use
  • Servlet: request.getRequestDispatcher(“jsp2.jsp”).forward(request, response);
  • JSP: <jsp:forward page=”include.jsp” />

相关文章:

  • 2021-06-06
  • 2021-11-30
  • 2021-07-17
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-01
  • 2021-07-03
  • 2022-01-20
  • 2021-07-06
  • 2021-04-14
  • 2021-05-01
  • 2021-09-07
相关资源
相似解决方案