日期:2014-05-18  浏览次数:20597 次

关于requestScope
以前做web 的练习 都是使用 requestScope 来获取前一个action 中request.setAttribute() 的数据 , 也就很自然的认为requestScope是获取request范围的时间, 今天看了个视频 才知道在jsp页面中 requestScope 也可以被 <%=request.getParamenter()%>所代替, 这个requestSope 到底是什么意思呢?

------解决方案--------------------
requestSope是EL的隐含对象,用于获取请求范围内的属性值,如${request.user.age}
request是jsp的内置对象,request.getParamenter("age")也是获取请求范围内的属性值
------解决方案--------------------
requestScope是jstl的隐含对象,代表request范围内可用的变量,
和jsp中使用request基本一样。

参考这篇文章:
http://www.informit.com/articles/article.aspx?p=30946&seqNum=7