for each换行按月份显示用户图片
来源:互联网 发布:js数据类型如何判断 编辑:程序博客网 时间:2024/05/21 10:32
页面核心代码:
<c:forEach items="${countlist}" var="ur" varStatus="k"><table width="600" align="center" border="1"><tr><td>${ur.time}</td></tr><!-- <tr> --><c:forEach items="${pictureList}" var="us" varStatus="status" begin="${ur.begin}" end="${ur.end}"><%-- <td><img src="${us.pictureurl}"/></td> --%><c:if test="${status.count eq 1 || (status.count-1) % 5 eq 0}"> <tr> </c:if> <td> <img src="${us.pictureurl}"/> <!--url为obj的一个属性--> </td> <c:if test="${status.count % 5 eq 0 || status.count eq 5}"> </tr> </c:if> </c:forEach><!-- </tr> --> </table></c:forEach>
后台核心代码
<pre name="code" class="html">@RequestMapping(value="test",method=RequestMethod.GET)public String test(@Validated User user,HttpServletRequest request, HttpServletResponse response,Model model) throws IOException{String sql="select count(*) from Picture GROUP BY time"; int total=userService.getUserPictureCount(sql); System.out.println("total++++++++++"+total); List<String> list =new ArrayList<String>(); String sql1="select time from picture where userid ='12' GROUP BY time order by time desc"; //String sql2="from Picture where userid ='12' and time='"+"' GROUP BY time"; String sql3="from Picture where userid ='12' order by time desc"; list=userService.getUseGroup(sql1); List<Picture> test = new ArrayList<Picture>(); test =userService.getPictureListBySql(sql3); // 某个用户的所有图片 List<Count> list1 =new ArrayList<Count>(); // ArrayList<Picture[]> pictureList = new ArrayList<Picture[]>();// List<PictureList> testlist =new ArrayList<PictureList>(); int begin=0; for(int i=0;i<list.size();i++){ System.out.println(list.get(i)); List<Picture> step = new ArrayList<Picture>(); String sql4="from Picture where userid ='12' and time='"+list.get(i)+"'"; step=userService.getPictureListBySql(sql4); Count c = new Count(); c.setBegin(String.valueOf(begin)); c.setEnd(String.valueOf(begin+step.size()-1)); c.setTime(list.get(i)); begin=begin+1; list1.add(c); } model.addAttribute("pictureList",test); model.addAttribute("countlist",list1); return "user/test";}
0 0
- for each换行按月份显示用户图片
- 报表按月份横向显示处理
- 报表按月份横向显示处理
- 按月份统计
- 按月份去旅游
- SQL 按月份查询报表
- 按月份打印日历函数
- oracle 查询按月份分组
- Oracle按月份累计求和
- 按月份分组查询例子
- 图片显示个数换行
- Asp按月份自动创建文件夹函数
- sql 按月份统计汇总排序
- sql语句按月份进行汇总分组
- 织梦dedecms — 按月份查询文章
- SQL统计查询(按月份)
- SQL 语句按月份统计查询
- 按月份时间循环的代码
- 学习HTML第二天
- IE6-9中tbody.innerHTML不能赋值问题;SCRIPT600:该操作的目标元件无效
- linux进程状态及转换关系
- 如何才能不崩溃 7: Dealing with Nothing
- Charles 从入门到精通
- for each换行按月份显示用户图片
- 51NOD 求n的阶乘的长度(斯特林公式)
- Preference Learning
- 如何才能不崩溃 8: Infrastructure
- YTU 2973: C语言习题5.25--文件操作2
- iOS-提示框的正确实现方式(iOS9)
- Bloom Filter概念和原理
- ubuntu android-studio快捷启动方式
- LeetCode 237 -Delete Node in a Linked List ( JAVA )