struts+dao+hibernate的问题

mimi5211 mimi5211 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
这是我的UserinfoDAOImpl.java
public List QueryAll() throws Exception {
//查询全部
List all=null;
String hql="from Userinfo as u";
Query q=this.session.createQuery(hql);
all=q.list();
return all;
}
这是我的ACTION:
public class UserinfoAction extends DispatchAction {
public ActionForward selectall(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {


try {

request.setAttribute("all", DAOFactory.getUserinfoInstance().QueryAll());


}catch (Exception e) {
}
return mapping.findForward("list");


}
}
这是我的DAO:
//查询全部
public List QueryAll()throws Exception;
请问ACTION里怎么样子写才能在页面上输出这样啊:
<logic:iterate id="userinfo" name="all">
<tr>
<td><bean:write name="userinfo" property="username"></bean:write></td>
<td><bean:write name="userinfo" property="realname"></bean:write></td>
<td><bean:write name="userinfo" property="roleid"></bean:write></td>
<td><bean:write name="userinfo" property="departmentid"></bean:write></td>
<td><bean:write name="userinfo" property="usertype"></bean:write></td>
<td><bean:write name="userinfo" property="mphone"></bean:write></td>
<td align="center"><a href="../user/add_user.jsp?uid=${user.userid }">详细</a></td>
</tr>
...全文

相关推荐

评论 8
收藏 已收藏
分享
返回顶部
mimi5211
Web 开发 81,108 成员 341,721 内容