System.err.println("commonDao:"+commonDao);打印出来是空的,各位帮忙看一下,我看了好久了。
action:
public class UserInfoAction extends BaseAction {
private IUserInfoBiz userInfoBiz;
public IUserInfoBiz getUserInfoBiz() {
return userInfoBiz;
}
public void setUserInfoBiz(IUserInfoBiz userInfoBiz) {
this.userInfoBiz = userInfoBiz;
}
public String ajax_json(){
userInfoBiz.saveUserInfo(userInfo);
Biz:
public class UserInfoBiz extends BaseBiz implements IUserInfoBiz{
IUserInfoDao userInfoDao;
public IUserInfoDao getUserInfoDao() {
return userInfoDao;
}
public void setUserInfoDao(IUserInfoDao userInfoDao) {
this.userInfoDao = userInfoDao;
}
public void saveUserInfo(UserInfo userInfo) {
this.userInfoDao.saveUserInfo(userInfo);
}
Dao:
public class UserInfoDao extends BaseDao implements IUserInfoDao {
public void saveUserInfo(UserInfo userInfo) {
System.err.println("commonDao:"+commonDao);
this.commonDao.saveOrUpdate(userInfo);
}
public abstract class BaseDao extends HibernateBaseDao
implements IBaseDao{
protected ICommonDao commonDao;
public ICommonDao getCommonDao() {
return commonDao;
}
public void setCommonDao(ICommonDao commonDao) {
this.commonDao = commonDao;
}
public class HibernateCommonDao extends HibernateDaoSupport implements ICommonDao {
applicationContext: