.getBean("") .callMethod("")的思路

1
2
CallMethodService service = ContextUtil.getBean("aiasset-obsoleteservice");	
JSONObject json = service.callMethod("exportObsoleteResmDetail", pagequery) ;

相当于

1
2
Obsoleteservice service = new Obsoleteservice();
JSONObject json = service.exportObsoleteResmDetail(pagequery);

再碰到此类问题的时候就跟进obsoleteservice类的exportObsoleteResmDetail方法,往下就是跟springMVC的跟进思路相同

为什么要这样写不直接new呢,问了一下同事说是因为直接new的话只能调用当前模块的类,而第一个写法可以跨模块获取


声明:
本文章用于学习交流,严禁用于非法操作,出现后果一切自行承担,阅读此文章表示你已同意本声明。

Disclaimer:
This article is for study and communication. It is strictly forbidden to use it for illegal operations. All consequences shall be borne by yourself. Reading this article means that you have agreed to this statement.