zoukankan      html  css  js  c++  java
  • 吴裕雄--天生自然JAVA开发JSP-Servlet学习笔记:response对象-重定向

    <%-- 
        Document   : doRedirect
        Created on : 2020-4-12, 8:04:22
        Author     : Administrator
    --%>
    
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <%
    // 生成页面响应
                out.println("====");
    // 重定向到redirect-result.jsp页面
                response.sendRedirect("redirect-result.jsp");
            %>
        </body>
    </html>
    <%-- 
        Document   : redirect-result
        Created on : 2020-4-12, 8:05:36
        Author     : Administrator
    --%>
    
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title> redirect目标页 </title>
        </head>
        <body>
            <h3>被重定向的目标页</h3>
            name请求参数的值:<%=request.getParameter("name")%>
        </body>
    </body>
    </html>

  • 相关阅读:
    服务器搭建Git
    BGP协议详解
    以太坊
    燃 * & *
    UML类图解析
    day8.文件操作
    python面试题汇总
    day5.字典
    day5.类型汇总
    day3,4总结程序
  • 原文地址:https://www.cnblogs.com/tszr/p/12683619.html
Copyright © 2011-2022 走看看