用hibernate查找出list里的object[]并在页面用struts2显示
2010-07-13 16:42
330 查看
后台代码
hql.append("select b.blackip,b.reason,u.username,b.ipAddtime from BlackList b,UserInfo u where b.userId=u.uid and webInfoId ='").append(id).append("' ");
List list = service.list(hql);
this.getRequest().setAttribute("list", list);
jsp页面
<s:iterator status="st" value="#request.list" id="id1">
<tr onmouseover="this.style.backgroundColor='#D7E6F9'" onmouseout="this.style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
<td> <s:property value="#request.list[#st.index][0]"/> </td>
<td> <s:property value="#request.list[#st.index][1]"/> </td>
<td> <s:property value="#request.list[#st.index][2]"/> </td>
<td> <s:property value="#request.list[#st.index][3]"/> </td>
<td><a href="#" onclick='edit(${st.index+1 },"${p.id }","${p.pname }","${p.content }");' id="edit_link">修改</a>|<a href="/CMS/project.do?method=delete&id=${p.id }" onclick="return confirm('你确定要删除吗?/n 删除后将无法恢复!');">删除</a></td>
</tr>
</s:iterator>
hql.append("select b.blackip,b.reason,u.username,b.ipAddtime from BlackList b,UserInfo u where b.userId=u.uid and webInfoId ='").append(id).append("' ");
List list = service.list(hql);
this.getRequest().setAttribute("list", list);
jsp页面
<s:iterator status="st" value="#request.list" id="id1">
<tr onmouseover="this.style.backgroundColor='#D7E6F9'" onmouseout="this.style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
<td> <s:property value="#request.list[#st.index][0]"/> </td>
<td> <s:property value="#request.list[#st.index][1]"/> </td>
<td> <s:property value="#request.list[#st.index][2]"/> </td>
<td> <s:property value="#request.list[#st.index][3]"/> </td>
<td><a href="#" onclick='edit(${st.index+1 },"${p.id }","${p.pname }","${p.content }");' id="edit_link">修改</a>|<a href="/CMS/project.do?method=delete&id=${p.id }" onclick="return confirm('你确定要删除吗?/n 删除后将无法恢复!');">删除</a></td>
</tr>
</s:iterator>
相关文章推荐
- Struts2 删除后直接直接到List显示页面
- hibernate查询出的list内容在前端页面无法显示解决方案
- 利用Struts2和Hibernate实现页面分页显示的功能
- Struts2的Action向JSP传输List集合并且将数据显示在页面上
- struts2 hibernate 在jsp页面上面显示多个图片
- 请求Action的路径、参数设置及Struts2的Action向JSP传输List集合并且将数据显示在页面上
- Struts2的Action向JSP传输List集合并且将数据显示在页面上
- struts2学习之---在页面中显示中文
- 用struts2来导入excel文件并显示到页面上
- 在SharePoint页面中如何显示来自其他网站的List
- Struts2标签——关于List<Object[]>的操作
- java中对list进行分页显示数据到页面
- 将List中一列的值取出来 求和后 放到页面显示 用BigDicamal
- Hibernate 对数据库Blob图片的查询操作---页面显示图片,文件的输出
- javaweb-list页面显示在弹出框内
- JSP中如何 循环显示 数据库中的数据到list.jsp页面 (转载)
- 运用freemaker 将后台传过来的 List<Map<String,String>> 类型的值显示到HTML页面
- List使用Struts2标签在jsp中显示
- Struts2上传图片到Mysql数据库中,以及显示到页面
- HTTP 错误 405.0 - Method Not Allowed 无法显示您正在查找的页面,因为使用了无效方法(HTTP 谓词)。