zoukankan      html  css  js  c++  java
  • Difference between sendRedirect, include, forward

    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” />
    路慢慢其休远羲,吾将上下而求所
  • 相关阅读:
    fiddler 使用
    IO多路复用
    scrapy下载 大文件处理

    session见解
    自定义分页
    COOKIE
    ORM之老师管理
    ORM之学生管理
    ORM之班级管理
  • 原文地址:https://www.cnblogs.com/garinzhang/p/2552793.html
Copyright © 2011-2022 走看看