1.jsp
<%@ page contentType="text/html; charset=gb2312" %>
<html><form name = "1" action="2.jsp" method = post>
<% 
HttpSession se=request.getSession(true);
se.setAttribute("aa","1");%>
<table><tr>
            <td align=center><input type="text" name="text" value=""></td>
        </tr>
        <tr><td align = center><input type="submit" name="submit" ></tr>
        </table>
</html>
2.jsp
<html>
<% HttpSession se= request.getSession();
  String s = se.getId();String a = (String)(se.getAttribute("aa")); %><table><tr>
            <td align=center><input type="text" name="text" value = <%=s%>></td>
        </tr>
        </table>
        
</html>