您的位置:首页 > 移动开发 > Objective-C

用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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: