code031.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>session保存</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String name = request.getParameter("name");
session.setAttribute("name", name);
%>
<form id="form1" name="form1" method="post" action="code032.jsp">
<table width="60%" border="0">
<tr>
<td>你的名字:</td>
<td><%= name %></td>
</tr>
<tr>
<td>你喜欢去的地方:</td>
<td>
<input type="text" id="address" name="address">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" id="submit" name="submit" value="提交内容">
</td>
</tr>
</table>
</form>
</body>
</html>