jsp显示数据库的查询结果

来源:互联网 发布:淘宝上传图片 编辑:程序博客网 时间:2024/05/22 00:11
<% List list=(List)request.getAttribute("list");if(list!=null&&list.size()>0){Iterator it = list.iterator();   while (it.hasNext()) {Job j = (Job) it.next();%><tr  bgcolor="#FFFFFF"><td height="22" align="center" ><%=j.getName()%></td><td height="22" align="center" ><%=new Byte("1").equals(j.getSex())?"男":"女"%></td><td height="22" align="center" ><%=j.getAge()%></td><td height="22" align="center" ><%=j.getJob()%></td><td height="22" align="center" ><%=j.getSpecialty()%></td><td height="22" align="center" ><%=j.getExperience()%></td><td height="22" align="center" ><a href="detailjob.do?action=detailjob&id=<%=j.getId()%>">详细</a>  <a href="modifyjob.do?action=deletejob&id=<%=j.getId()%>">删除</a><%if(j.getIsstock()!=null&&j.getIsstock().intValue()==0){%><a href="modifyjob.do?action=updatejob&id=<%=j.getId()%>&isstock=1">入库</a></td><%}%></tr><%}}else{%><tr  bgcolor="#FFFFFF"><td height="22" colspan="7" align="center" >对不起,没有信息!!!</td></tr><%}%>


private ActionForward listUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){    request.setAttribute("list",dao.listUser());//将人员信息列表保存到request范围    return mapping.findForward("success");//跳转到成功页面}


0 0
原创粉丝点击