UserDaoImpl.java中相关代码
- Java code
public void delete(int id) { [color=#FF0000] this.getHibernateTemplate().delete(this.getUserInfo(id)) ;[/color] }
UserManagerServiceImpl.java中相关代码
- Java code
public void deleteUser(int id) { [color=#FF0000]this.userDao.delete(id);[/color] } public UserInfo getUser(int id) { return this.userDao.getUserInfo(id); }
ZspAction.java中相关代码
- Java code
public String delete() { UserManagerService b= (UserManagerService) DefaultBeanFactory.getBean("UserManagerService"); if (this.name !=" ") { [color=#FF0000] b.deleteUser(this.id);[/color] } else { if (ids.length > 0) { for (int id : ids) { b.deleteUser(id); } } } if (b.listUser().size() > 0) { return "list_delete"; // return SUCCESS; } else { return INPUT; } }
红色的为报错的行,我是新手,貌似错误很多,希望高手指点。
------解决方案--------------------------------------------------------
(this.id)这个有值吗?说你删除一条不存在的记录··