request.setAttribute 为什么不能在jsp间传递对象?
test.jsp 如下
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import = "com.mod.FormBean" %>
<%
FormBean fb = new FormBean();
request.setAttribute("aa",fb);
%>
<html>
<head>
<script language="JavaScript" ></script>
</head>
<body>
<form name = "form1" action="test2.jsp" method="post">
<input type="submit" name="b1" value="submit">
</form>
</body>
</html>
--------
test2.jsp 如下
<%
Object obj = request.getAttribute("aa");
out.println(obj.toString());
%>
上例子中我想在test.jsp中把FormBean 传递到test2.jsp 中, 可是我用request.getAttribute("aa") 得到的是Null
请问我如何做才能实现在jsp间传递java 对象? 请给代码参考,谢谢.