日期:2014-05-20  浏览次数:20819 次

ssh2问题
最近单位要用到SSH2 我刚学习 所以遇见一些问题 请大家帮帮忙
这是dao:
//自定义函数 查询所有的用户
public List<User> getUser(){
log.debug("find all user");
try {
return (List<User>)this.getHibernateTemplate().find("from User");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}

这是service:
public List<User> getUser(){
if(iuserdao.getUser().size()>0){
return iuserdao.getUser();
}else{
return null;
}
}
这是action:
public String listUser(){
this.listuser=this.ilogin.getUser();
return "list";
}
这是struts.xml:
<action name="listUser" class="com.action.LoginAction" method="listUser"> 
  <result name="list">/index.jsp</result>
  </action>

这是前台jsp:
<s:iterator value="listUser">
<tr>
<td><s:property value="user.userid"/></td>
<td><s:property value="user.username"/></td>
<td><s:property value="user.userpass"/></td>
</tr>
</s:iterator>







现在的问题是我运行jsp 看不到效果 不走action 实在找不到原因了 请大家帮我看看

------解决方案--------------------
<s:iterator value="listuser" id="user">
<tr>
<td><s:property value="user.userid"/></td>
<td><s:property value="user.username"/></td>
<td><s:property value="user.userpass"/></td>
</tr>
</s:iterator>
------解决方案--------------------
<s:iterator value="listuser" id="user">
<tr>
<td><s:property value="#user.userid"/></td>
<td><s:property value="#user.username"/></td>
<td><s:property value="#user.userpass"/></td>
</tr>
</s:iterator>
------解决方案--------------------
探讨
网上有说不加id也可以啊