从医生那里:
在包含要注入的方法(在本例中为CommandManager )的客户端类中,要“注入”的方法必须具有以下形式的签名:
<public|protected> [abstract] <return-type> theMethodName(no-arguments);是否存在解决这一限制的方法?
发布于 2012-04-28 17:02:30
是的你可以。下面是spring的一个示例,http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html
@Autowired
public void prepare(MovieCatalog movieCatalog,
CustomerPreferenceDao customerPreferenceDao) {
this.movieCatalog = movieCatalog;
this.customerPreferenceDao = customerPreferenceDao;
}https://stackoverflow.com/questions/10365560
复制相似问题