日期:2014-05-17 浏览次数:20989 次
<%@ page language="java" import="java.sql.*,java.util.*" pageEncoding="utf-8" %>
<html>
<body>
<%
String id=UUID.randomUUID().toString();
session.setAttribute("key",id);
%>
<form name="form1" method="post">
<input type="text" name="key" size="50%" value="<%=session.getAttribute("key")%>"><BR>
<input type="submit" value="提交">
</form>
<%
request.setCharacterEncoding("utf-8");
String key=request.getParameter("key");
String ID=(String)session.getAttribute("key");
out.println("表单的key:"+key);
out.println("session的key:"+ID);
%>
</body>
</html>