[ECSide] 为什么使用list时jsp中能出来数据而使用arrylist则出不来数据?
lxxing
2007-07-13
为什么使用list时jsp中能出来数据而使用arrylist则出不来数据?
|
|
lxxing
2007-07-13
没有人知道吗?
|
|
Ex_785
2007-07-13
嗯,我初步认为你的类名有问题,所以……
呵呵,开玩笑的 你能把你的代码帖上来看看吗? |
|
lxxing
2007-07-13
//UserList部分代码 public ComList get(int startSerial,int maxLen,String sqlFilter){ int pageSize=org.infosys.common.Constants.PAGE_SIZE; ComList itera=new ComList(); ComParam para; String PagesStr=""; Session session; try { session = SessionFactory.currentSession(); Query query=session.createQuery("from PUserExt a,PUserBase b,PGroup c where a.userid=b.userid and a.groupid=c.groupid "+sqlFilter+" order by a.regtime desc"); query.setFirstResult(startSerial); query.setMaxResults(maxLen); List querylist=query.list(); if(querylist!=null && querylist.size()>0){ List list=new ArrayList(); Object[] tmpObj; PUserExt userExt; PUserBase userBase; PGroup userGroup; String bgcolor="#ffffff"; for(int i=0;i<querylist.size();i++){ bgcolor=((i % 2)==0)?"#ffffff":"#eaeaea"; tmpObj=(Object[])querylist.get(i); userExt=(PUserExt)tmpObj[0]; userBase=(PUserBase)tmpObj[1]; userGroup=(PGroup)tmpObj[2]; para=new ComParam(); para.setParam0(bgcolor); para.setParam1(userExt.getUserid()); para.setParam2(userExt.getAccount()); para.setParam3(userBase.getName()); para.setParam4(userGroup.getName()); para.setParam5(ParamUtil.getDate(userExt.getRegtime(),"yyyy-MM-dd HH:mm:ss")); para.setParam6((userExt.getStatus().intValue()==1)?"����":"ͣ��"); list.add(para); } itera.setParamlist(list); userGroup=null; userExt=null; userBase=null; tmpObj=null; } querylist=null; } catch (HibernateException e) { e.printStackTrace(); } finally { try { SessionFactory.closeSession(); } catch (HibernateException e1) { e1.printStackTrace(); } } return itera; } //Action中部分代码 ComList itera=new ComList(); itera=(new UsersList()).get(Integer.parseInt(dbPagesArr[0]),pageSize,sqlFilter); if(itera.getParamlist()!=null && itera.getParamlist().size()>0){ isdata=true; //有数据 } request.setAttribute("ComList",itera); //JSP页面 <ec:table items="ComList" var="paramlist" retrieveRowsCallback="process" action="${pageContext.request.contextPath}/admin/users_man.do" title="客户列表" > <ec:row> <ec:column width="50" property="_1" title="序号" sortable="false" filterable="false"editable="false" >${GLOBALROWCOUNT} </ec:column> <ec:column width="100" property="Param1" title="test" > </ec:column> </ec:row> </ec:table> |