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” />
    路慢慢其休远羲,吾将上下而求所
  • 相关阅读:
    SSM框架整合步骤
    Spring-data-jpa
    allure定制报告
    pytest常用选项
    staticmethod&classmethod&property
    __slot__
    python的参数传递
    闭包和装饰器
    内置高阶函数
    str
  • 原文地址:https://www.cnblogs.com/garinzhang/p/2552793.html
Copyright © 2011-2022 走看看