<foreach collection="list" item="item" index="index" open="" close="" separator=";">属性的含义
来源:互联网 发布:围巾怎么系 知乎 编辑:程序博客网 时间:2024/05/21 06:25
foreach的主要用在构建in条件中,它可以在SQL语句中进行迭代一个集合。
foreach元素的属性主要有 item,index,collection,open,separator,close。
item集合中每一个元素进行迭代时的别名,
index表示在迭代过程中,每次迭代到的位置,
open该语句以什么开始,
separator在每次进行迭代之间以什么符号作为分隔 符,
close以什么结束,
在使用foreach的时候最关键的也是最容易出错的就是collection属性,
该属性是必须指定的,但是在不同情况 下,该属性的值是不一样的,
主要有一下3种情况:
1. 如果传入的是单参数且参数类型是一个List的时候,collection属性值为list
2. 如果传入的是单参数且参数类型是一个array数组的时候,collection的属性值为array
3. 如果传入的参数是多个的时候,我们就需要把它们封装成一个Map了
阅读全文
0 0
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">属性的含义
- Mybatis使用<foreach collection="***" item="**" open="(" separator="," close=")">问题
- ListView同一个适配器设置不同的item时遇到java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
- adapter适配器中有不同item时可能会报java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
- Array#[index]=
- 关于<c:forEach var="item " items="${ns }">中要注意的问题
- JS使用xxx.index=0 和 xxx.setAttribute(‘index’,0) 这两种设置自定义属性的区别?
- <meta name="robots" content="INDEX,FOLLOW">的含义 seo
- index of("") ==-1
- <c:forEach items="${userList}" varStatus="i" var="item" >
- {html_options options=$item.options selected=$item.value}
- yuekao=xml=item
- List foreach 删除ITEM的方法
- e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem
- e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem
- $.each(json,function(index,item){ });
- Listview 获取由不可见到可见的item的index
- WPF listBox 显示每个Item的index值
- Java 模板技术
- Java Socket 单线程的简单入门案例
- centos7下安装mysql
- Jboss使用相关整理
- android kernel 添加时间log
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">属性的含义
- 【SQL】 操作架构、索引和视图
- Velodyne推出了首款128线激光雷达,据说它是全自动驾驶落地的利器
- Flask框架知识系列之二
- iOS 线程锁
- ValueError: View function did not return a response(关键词:Web开发/bug)
- 设计模式 ( 十七) 状态模式State(对象行为型)
- 【SQL】数据查询和管理
- Android 8.0 user版本adb remount后系统卡死问题分析