el 中requestScope和param

${scope.attribute},其中scope指pageSocpe、requestScope、sessionScope、applicationScope,attribute指的就是你在某个scope中设置的属性了。

 

1、requestScope时页面获取从服务端传来的值

相当于:request.getAttributes("")

表明一个http请求的整个声明周期。

 

2、params用于页面间传递参数

可以使用:request.getParameter("")代替

 

注意:

${param.name} 等价于 request.getParamter("name"),这两种方法一般用于服务器从页面或者客户端获取的内容。

${requestScope.name} 等价于 request.getAttribute("name"),一般是从服务器传递结果到页面,在页面中取出服务器保存的值。 

${name}没有指定从哪个作用域中取数据,会按顺序pageScope、requestScope、sessionScope、applicationScope,从最小的作用域开始搜索为name的值。

 

posted on 2016-12-18 22:18  _故乡的原风景  阅读(182)  评论(0编辑  收藏  举报