getAttribute()是session对象的方法,与session.setAttribute()对应getParameter()是request对象的方法,是用来取得上一页面传过来的表单或querystring的
如下:
a.jsp里
session.setAttribute("aaa","hello");
到b.jsp里就用
String aaaa=session.getAttribute("aaa");来取得hello这个String.
在aa.html里
<form method=post action=bb.jsp>
<input type=text name=id>
<input type=submit name=to>
</form>
bb.jsp就要用request.getParameter("id");来取得
表单中<input type=text name=id>里面输入的数据