不能用RequestDispatcher,因为是点击jsp1提交转到jsp2的,如何在jsp2里获取jsp1保存的对象?
jsp1:<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
jsp1
</title>
</head>
<%
request.setAttribute("str","hello");
%>
<body bgcolor="#ffffff">
<form name="form1" method="post" action="jsp2.jsp">
  <input type="text" name="textfield" id="textfield">
  <input type="submit" name="button" id="button" value="提交">
</form>
</body>
</html>
jsp2<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
jsp2
</title>
</head>
<body bgcolor="#ffffff">
<h1>
<%=request.getAttribute("str").toString()%>
</h1>
</body>
</html>