----------------------------------------------------------------------------------------------------------------------------------
request.jsp
----------------------------------------------------------------------------------------------------------------------------------
<%@ page contentType ="text/html;charset = GBK"%>
<html>
<head>
<title>
request内置对象实例
</title>
</head>
<body>
<form action = "request.jsp">
<br>Get request result:
<br><input type="text" name="myname">
<br><input type="submit" name="get value">
</form>
返回HTTP请求信息中使用的方法名称:<%=request.getMethod()%>
<br>
返回请求信息中调用Servlet的URL部分:<%=request.getServletPath()%>
<br>
返回HTTP GET请求信息中URL之后的的查询字符串:<%=request.getQueryString()%>
<br>
返回请求实体MIME类型:<%=request.getContentType()%>
<br>
请求返回信息中的协议名字和版本号:<%=request.getProtocol()%>
<br>
有关任何路径的信息<%=request.getPathInfo()%>
<br>
返回接受请求的服务器主机:<%=request.getServerName()%>
<br>
返回服务器的端口号:<%=request.getServerPort()%>
<br>
返回提交请求的客户机规范的名字:<%=request.getRemoteHost()%>
<br>
返回提交请求的客户机的IP地址:<%=request.getRemoteAddr()%>
<br>
返回请求中使用的模式(协议)名字:<%=request.getScheme()%>
<br>
返回这个request值,提交过来的值:<%=request.getParameter("myname")%>
</body>
</html>
----------------------------------------------------------------------------------------------------------------------------------
page.jsp
----------------------------------------------------------------------------------------------------------------------------------
<%@ page language="java" contentType="text/html;charSet=GBK" %>
<%@ page import = "java.lang.Object" %>
<html>
<body>
<center><h3>Page内置对象的实例</h3></center>
<%!Object obj;%>
getClass : <%=page.getClass()%>
<br>
hashCode : <%=page.hashCode()%>
<br>
toString : <%=page.toString()%>
<br>
equals : <%=page.equals(obj) %>
<br>
equlas2 : <%=page.equals(this)%>
</body>
</html>