九大内置对象
1.request对象
<%@page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>201819102007都悦彤</title>
</head>
<body>
<form action="index.jsp"method="post">
用户名:<input type="text" name="user"/></br/>
密 码:<input type="password" name="pwd"/></br/>
<input type="submit" name="登陆"/>
</form>
</body>
</html>
2.session对象
在这里插入代码片<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>201819102007都悦彤</title>
</head>
<body>
<form action="do_login.jsp" method="post">
userName:<input type="text" name="userName"><br/>
password:<input type="password" name="password"><br/>
<input type="submit" value="submit">
<input type="reset" value="reset">
</body>
</html>
3.out对象
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>201819102007都悦彤</title>
</head>
<body>
<%
out.print("helloworld");
// out.clearBuffer(); // 将缓冲区的数据清空
out.flush(); // 先显示数据在清空缓存
out.println("缓冲区空间:" + out.getBufferSize());
out.print("剩余空间:" + out.getRemaining());
out.print("AutoFlush状态:" + out.isAutoFlush());
out.close();
%>
</body>
</html>
4.response对象
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>201819102007都悦彤</title>
</head>
<body>
<%!int i=0; %>
<%
response.setHeader("refresh","1");
%>
<%=i++ %>
</body>
</html>
5.page对象
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>201819102007都悦彤</title>
</head>
<body>
<%! Object object; //声明一个Object型的变量 %>
<ul>
<li>getClass()方法的返回值:<%=page.getClass()%></li>
<li>hashCode()方法的返回值:<%=page.hashCode()%></li>
<li>toString()方法的返回值:<%=page.toString()%></li>
<li>与Object对象比较的返回值:<%=page.equals(object)%></li>
<li>与this对象比较的返回值:<%=page.equals(this)%></li>
</ul>
</body>
</html>