您的位置:首页 > 其它

EL中的param 与params

2015-12-16 08:59 309 查看
在表单提交页面中,经常会使用到param.***

如图:
<form name="queryForm" id="queryForm" action="?" method="get">
<table>
<tr>
<td>订单号:</td>
<td><input type="text" name="id" value="${param.id}" class="txt validate-number"  style="width:206px"/></td>
<td></td>
<td></td>
<td>手户手机号:</td>
<td><input type="text" name="mobile" value="${param.mobile}" class="txt validate-number"  style="width:206px"/></td>
</tr>
<tr>
               <td>商品名称:</td>
<td><input type="text" name="goodsTitle" value="${param.goodsTitle}" class="txt" style="width:206px"/></td>
</tr>
<tr>
<td>
<ct:btn type="search" />

</td>
</tr>

</table>
</form>
正如上图所示,查询后还是回显到当前的列表页面,所以我们需要用到

${param.id}等价于request.getParameter("id"),{param[id]}也是一样的。

${params.id}等价于request.getParameterValues("id"),大多用于获取客户端的数组数据,如页面的复选框的值。

注意:${requestScope.id} 等价于 request.getAttribute("id")

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

各种得到属性的EL表达式:

${scope.attribute},其中scope指pageSocpe、requestScope、sessionScope、applicationScope,attribute指的就是你在某个scope中设置的属性了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: