`

配置中的细节 错误 DWR

dwr 
阅读更多

今天遇到了:data.callDWRBusiness:'' 未定义
通常:要运行DWR 条件是 applicationContext_dwr对所需的DWR配置
在一个在dwr.XML中在进行配置 还有一个 在jsp 页面中要引用它。

结果发现我出现的错误的原因是在dwr.xml中的配置缺少了。

Bean property 'userService' is not writable or has an invalid setter method
在Dwr中配置Service 是出现的问题:从异常错误中看到了setter 问题 说明问题出现在DWR中对应用的service的setter方法错误在java中特别是配置文件中队字母的大小写特别注意 有一点出入都会报异常 。在returngood.Dwr仔细的观察 发现 private IReturnGoodService returngoodService;的setter方法的字母大小写问题。
public IReturnGoodService getReturngoodService() {
return returngoodService;
}

 

public void setReturngoodService(IReturnGoodService returngoodService) {
this.returngoodService = returngoodService;
}

而之前错误的时候时:
public IReturnGoodService getReturnGoodService() {
return returngoodService;
}

public void setReturnGoodService(IReturnGoodService returngoodService) {
this.returngoodService = returngoodService;
}
注意两者之间的区别了吧 getReturngoodService和getReturnGoodService setReturnGoodService和setReturnGoodService
所以在命名规范很重要 ,不然在配置文件中易出错。POJO与hdb.xml的匹配特比要细心,现在我(新手)还没有用Myeclipse进行生成POJO和对应hdb.xml 但是要细心。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics