zoukankan      html  css  js  c++  java
  • JAVA-JSP内置对象之response对象实现页面跳转

    相关资料:
    《21天学通Java Web开发》

    response对象

    实现页面跳转
    1.可以通过response对象的sendRedirect()方法设置页面重定向,从而实现页面跳转。
    2.这种跳转将改变浏览器地址栏信息,所以也称为客户端跳转。

    ResponseDemo.jsp

     1 <%@ page language="java" contentType="text/html;charset=gb2312" %>
     2 <html>
     3 <head>
     4   <title>设置页面跳转</title>
     5 </head>
     6 <body>
     7   <%-- 使用response对象的sendRedirect实现页面跳转 --%>
     8   <%
     9     response.sendRedirect("DirectPage.jsp");//进行页面跳转
    10   %>
    11 </body>
    12 </html>
    View Code

    DirectPage.jsp

    1 <%@ page language="java" contentType="text/html;charset=gb2312" %>
    2 <html>
    3 <head>
    4   <title>跳转到页面</title>
    5 </head>
    6 <body>
    7   <h4>跳转到页面</h4>
    8 </body>
    9 </html>
    View Code
  • 相关阅读:
    tps,qps
    JS打包与代码分割
    css module
    垃圾回收算法、内存管理
    css flex布局
    angularJS transclude
    JS模块之AMD, CMD, CommonJS、UMD和ES6模块
    js event loop事件循环
    bootstrap3之栅格系统
    viewport理解
  • 原文地址:https://www.cnblogs.com/FKdelphi/p/7670184.html
Copyright © 2011-2022 走看看