日期:2014-05-17  浏览次数:21044 次

cannot be cast to java.util.Collection
Java code
package com.hollycrm.hollyv8.zsptest.zsp.service.impl;

import ...
public class UserManagerServiceImpl implements UserManagerService {
    private UserManagerDao userDao;
   
    public void setUserManagerDao(UserManagerDao userDao){
          
          this.userDao = userDao ;
         }
         public UserManagerDao getUserManagerDao(){
          
          return this.userDao ;
         }


         public void addUser(UserInfo user) {

          this.userDao.add(user) ;

         }

        public void deleteUser(String account) {
                // TODO Auto-generated method stub
            this.userDao.delete(account)    ;
            }
            public UserInfo getUser(String account) {
                // TODO Auto-generated method stub
                return this.userDao.getUserInfo(account);
            }
            public UserInfo getUser(String name, String account) {
                // TODO Auto-generated method stub
                List<UserInfo> list = this.userDao.getUserInfo(name, account);
                if(list != null&&list.size() > 0){
                    return list.get(0);
                }else{
                return null;
                }
            }
            public List<UserInfo> listUser() {
                // TODO Auto-generated method stub
                return this.userDao.getUserInfos();
            }
            public void saveOrUpdate(UserInfo user) {
                // TODO Auto-generated method stub
                this.userDao.saveOrUpdate(user);
            }
            public UserInfo query(){               
                return this.userDao.query();
            }    

}



Java code
com.hollycrm.hollyv8.zsptest.zsp.service.impl.UserManagerServiceImpl cannot be cast to java.util.Collection 



大家帮我看看这是怎么回事?

------解决方案--------------------
探讨

这个问题已经解决,但是现在的问题是输入的数据能够提交到数据库中,但是页面上显示不出来。我怀疑是下面的问题,不知道对不对。Java code
<s:iterator value="users" >
<tr>
<td><s:property value="account"/></td>
<td><s:property value="nam……