查询显示问题 daoimpl:
public class UserInfoDaoImpl implements UserInfoDao {
private SessionFactory sessionFactory;
public List queryNumber(String name)
{
String sql="select * from userinfo a left outer join buyerin b on a.buyerid = b.buyerid where a.Aname=?";
SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery(sql);
query.setString(0, name);
query.addEntity(UserInfo.class);
List rs= query.list();
return rs;
}
service:
public class UserInfoServiceImpl implements UserInfoService{
private UserInfoDao userInfoDao;
public List query(String name){
List rs=userInfoDao.queryNumber(name);
return rs;
}
action:
public String query(){
List result = userInfoService.query(name);//接受list后跳转
if( result == null){
return "error";
}
return "query1";
}
jsp:
<s:iterator value="result">
<tr>
<td><s:property value="userinfo.name"/></td>
<td><s:property value="userinfo.buyerid"/></td>
<td><s:property value="user.adminid"/></td>
</tr>
</s:iterator>