request
response
out
session
application
response.sendRedirect
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Redirect Example</title>
</head>
<body>
<%
// 重定向到另一个页面
response.sendRedirect("b1.jsp");
%>
</body>
</html>
<%@ page contentType="text/html;charset=GB2312" language="java"
pageEncoding="GB2312" import="java.util.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>b</title>
</head>
<body bgcolor="#ccffcc">
<h1>这里是b1.jsp<br></h1>
</body>
</html>
访问:http://localhost:8080/test/response.jsp
直接跳转到b1.jsp页面
response.setHeader("refresh", "3");//对属性refresh赋值,页面每一秒刷新一次
<%@ page contentType="text/html;charset=GB2312" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>使用response内置对象--responseRefresh.jsp</title>
</head>
<body>
<h3>现在的时间是:</h3>
<hr/>
<%=new java.util.Date()%>
<%
response.setHeader("refresh", "3");//对属性refresh赋值,页面每一秒刷新一次
%>
<hr/>
</body>
</html>