一out
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>201819101026郝永华</title>
</head>
<body>
<%
out.print("您好");
%>
<%="您好吗"%>
<pre>
<%
out.println("<b>使用println()方法向客户端浏览器输出文字:</b>");
out.println("您好!");
out.println("欢迎访问");
out.println("博客地址:https://i.csdn.net/#/uc/profile");
%>
</pre>
<%
out.print("你好呀");
out.flush();
out.println("缓冲区空间:" + out.getBufferSize());
out.print("剩余空间:" + out.getRemaining());
out.print("AutoFlush状态:" + out.isAutoFlush());
out.close();
%>
</body>
</html>
```java
```java
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>201819101026郝永华</title>
</head>
<body>
<%! 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>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>201819101026郝永华</title>
</head>
<body>
<form>
<hr action="requstPage.jsp" method="post" >
用户名: <br/>
<input type="text" name="name"><hr/>
男 <input type="radio" name="gender" value="男">
女 <input type="radio" name="gender" value="女"><hr/>
学院:<br/>
传媒学院:<input type="checkbox" name="color" value="紫">
教育学院:<input type="checkbox" name="color" value="绿">
计算机学院:<input type="checkbox" name="color" value="蓝"><hr/>
来自的地区:<br/>
<select name="country">
<option value="内蒙古">内蒙古</option>
<option value="湖南">长沙</option>
<option value="四川">成都</option>
</select></hr>
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</body>
</html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<body>
<%
Object obj=application.getAttribute("counter");
if (obj==null){
application.setAttribute("counter",new Integer(1));
out.println("该页面被访问了5次<br/>");
}else {
int countValue=new Integer(obj.toString());
countValue++;
out.println("该页面被访问了"+countValue+"次<br/>");
application.setAttribute("counter",countValue);
}
%>
</body>
</body>
</html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<meta http-equiv="Content-Type" content="text/html;charst=utf-8">
<title>response</title>
</head>
<body>
<center>
跳转页面到百度主页
<%
</center>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath%>">
<title>session1</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<form id="form1" name="form1" method="post" action="session2.jsp">
<div align="center">
<table width="40%" border="0">
<tr>
<td width="36%"><div align="center">您的名字是:</div></td>
<td width="64%">
<label>
<div align="center">
<input type="text" name="name" />
</div>
</label>
</td>
</tr>
<tr>
<td colspan="2">
<label>
<div align="center">
<input type="submit" name="Submit" value="提交" />
</div>
</label>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>config</title>
</head>
<body>
<%
String url = config.getInitParameter("url");
String str = config.toString();
out.print("page对象的initParameter方法:"+url+"</br>");
out.print("page对象的toString方法:"+str);
%>
</body>
</html>
标题
<%@ page contentType="textml;charset=UTF-8" language="java" errorPage="error.jsp" %>
<html>
<head>
<title>201819101026郝永华</title>
</head>
<body>
<%
int a=8;
int b=0;
int c=a/b;
%>
</body>
</html>
<%@ page contentType="text/html;charset=UTF-8" language="java"
pageEncoding="UTF-8" isErrorPage="true"%>
<html>
<head>
<title>异常</title>
</head>
<body>
<hr>
异常类型:<%=exception.getClass()%><br/><br/>
异常信息:<%=exception.getMessage()%>
<hr/>
</body>
</html>