首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

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

2012-04-21 
cannot be cast to java.util.CollectionJava codepackage com.hollycrm.hollyv8.zsptest.zsp.service.imp

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……

热点排行