当前位置: 代码迷 >> Java Web开发 >> cannot be cast to java.util.Collection解决方法
  详细解决方案

cannot be cast to java.util.Collection解决方法

热度:11067   发布时间:2013-02-25 21:22:49.0
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……
  相关解决方案