struts2中把查询出来的数据如何通过jsp显示
action的方法:
/**
*修改信息的方法使页面跳转到相应的页面
*/
public String modify(){
HttpServletRequest request=ServletActionContext.getRequest();
String positionId=request.getParameter("roleId");
//System.out.println("前台传过来的Id:"+positionId);
String hql="from Position p where p.positionId="+positionId;
List<Position> list=positionService.findEntitybyHQL(hql);
request.setAttribute("list",list);
return "modify";
}
jsp:页面
<s:iterator value="#request.list">
<tr height="28px">
<td maxlength="16" cssStyle="width:100%;" cssmaxlength="30" cssStyle="width:100%;" cssstatus="st">
<tr style="background: <s:if test="#st.odd">#ccffff</s:if><s:else>#ccff99</s:else>" onclick="enterEdit('<s:property value="positionId"/>')">
<td><div align="center"><input type="checkbox" name="checkItems" value="<s:property value="positionId"/>"/></div></td>
<td><div align="center"><s:property value="positionId"/> </div></td>
<td><div align="center"><s:property value="positionNo"/></div></td>
<td><div align="center"><s:property value="positionName"/></div></td>
<td><div align="center"><s:property value="jobClass"/></div></td>
<td><div align="center"><s:property value="workDesc"/></div></td>
<td><div align="center"><s:property value="workDemand"/></div></td>
<td><div align="center"><label onclick="setRoleRights('<s:property value="positionId"/>')"> 权限</label></div></td>
<td><div align="center"></div></td>
</tr>
</s:iterator>